没有合适的资源?快使用搜索试试~ 我知道了~
C++/CLI Standard.pdf
4星 · 超过85%的资源 需积分: 10 98 下载量 185 浏览量
2007-02-27
14:34:51
上传
评论
收藏 902KB PDF 举报
温馨提示
试读
191页
This International Standard is based on a submission from Microsoft. It describes a technology, called C++/CLI, that is a binding between the Standard C++ programming language and the ECMA and ISO/IEC Common Language Infrastructure (CLI) (§3). That submission was based on another Microsoft project,
资源推荐
资源详情
资源评论
Publication Time: 6/17/2004 11:44 PM
Ecma/TC39-TG5/2004/25
C++/CLI
Language Specification
Working Draft 1.5, Jun, 2004
Public Review Document
Text highlighted like this indicates a placeholder for some future action. It might be a note from the editor to
himself, or an indication of the actual or expected direction of some as-yet open issue.
Note: In the spirit of the "Working Draft, Standard for Programming Language C++", this is an early draft.
It’s known to be incomplet and incorrekt, and it has lots of bad formatting.
Table of Contents
iii
Table of Contents
Introduction....................................................................................................................................................xi
1. Scope.............................................................................................................................................................1
2. Conformance ...............................................................................................................................................2
3. Normative references..................................................................................................................................3
4. Definitions....................................................................................................................................................4
5. Notational conventions................................................................................................................................7
6. Acronyms and abbreviations .....................................................................................................................8
7. General description.....................................................................................................................................9
8. Language overview....................................................................................................................................10
8.1 Getting started ....................................................................................................................................... 10
8.2 Types ..................................................................................................................................................... 10
8.2.1 Fundamental types and the CLI ...................................................................................................... 12
8.2.2 Conversions .................................................................................................................................... 13
8.2.3 Array types...................................................................................................................................... 13
8.2.4 Type system unification.................................................................................................................. 13
8.2.5 Pointers, handles, and null .............................................................................................................. 14
8.3 Parameters ............................................................................................................................................. 15
8.4 Automatic memory management........................................................................................................... 17
8.5 Expressions............................................................................................................................................ 18
8.6 Statements.............................................................................................................................................. 18
8.7 Delegates ............................................................................................................................................... 18
8.8 Native and ref classes ............................................................................................................................ 19
8.8.1 Literal fields.................................................................................................................................... 19
8.8.2 Initonly fields.................................................................................................................................. 20
8.8.3 Functions......................................................................................................................................... 20
8.8.4 Properties ........................................................................................................................................ 21
8.8.5 Events.............................................................................................................................................. 23
8.8.6 Static operators ............................................................................................................................... 24
8.8.7 Instance constructors....................................................................................................................... 25
8.8.8 Destructors ...................................................................................................................................... 25
8.8.9 Static constructors........................................................................................................................... 25
8.8.10 Inheritance .................................................................................................................................... 25
8.8.10.1 Function overriding................................................................................................................ 25
8.9 Value classes ......................................................................................................................................... 27
8.10 Interfaces ............................................................................................................................................. 27
8.11 Enums.................................................................................................................................................. 29
8.12 Namespaces and assemblies ................................................................................................................ 29
8.13 Versioning ........................................................................................................................................... 30
8.14 Attributes ............................................................................................................................................. 31
8.15 Generics............................................................................................................................................... 32
8.15.1 Creating and consuming generics ................................................................................................. 32
8.15.2 Constraints .................................................................................................................................... 33
8.15.3 Generic functions.......................................................................................................................... 34
9. Lexical structure........................................................................................................................................36
9.1 Tokens ................................................................................................................................................... 36
9.1.1 Identifiers ........................................................................................................................................ 36
C++/CLI Language Specification
iv
9.1.2 Keywords ........................................................................................................................................ 37
9.1.3 Literals ............................................................................................................................................ 37
9.1.3.1 The null literal .......................................................................................................................... 38
9.1.4 Operators and punctuators .............................................................................................................. 38
10. Basic concepts..........................................................................................................................................39
10.1 Members.............................................................................................................................................. 39
10.1.1 Value class members..................................................................................................................... 39
10.1.2 Delegate members......................................................................................................................... 39
10.2 Member access .................................................................................................................................... 40
10.2.1 Declared accessibility ................................................................................................................... 40
11. Preprocessor ............................................................................................................................................ 41
11.1 Predefined macro names...................................................................................................................... 41
12. Types ........................................................................................................................................................42
12.1 Fundamental types............................................................................................................................... 42
12.2 Class types ........................................................................................................................................... 43
12.2.1 Native classes................................................................................................................................ 43
12.2.2 Value classes................................................................................................................................. 43
12.2.2.1 Simple value classes............................................................................................................... 43
12.2.2.2 Enum classes .......................................................................................................................... 43
12.2.3 Ref classes..................................................................................................................................... 43
12.2.4 Interface classes ............................................................................................................................ 43
12.2.5 Delegate types............................................................................................................................... 43
12.2.6 Arrays............................................................................................................................................ 43
12.3 Declarator types................................................................................................................................... 43
12.3.1 Raw types...................................................................................................................................... 43
12.3.2 Pointer types ................................................................................................................................. 43
12.3.3 Handle types ................................................................................................................................. 44
12.3.4 Null type ....................................................................................................................................... 44
12.3.5 Reference types............................................................................................................................. 44
12.3.6 Interior pointers............................................................................................................................. 45
12.3.6.1 Definitions.............................................................................................................................. 45
12.3.6.2 Target type restrictions........................................................................................................... 45
12.3.6.3 Operations .............................................................................................................................. 45
12.3.6.4 Conversion rules..................................................................................................................... 46
12.3.6.5 Data access ............................................................................................................................. 46
12.3.6.6 The this pointer....................................................................................................................... 47
12.3.7 Pinning pointers ............................................................................................................................ 47
12.3.7.1 Definitions.............................................................................................................................. 47
12.3.7.2 Target type restrictions........................................................................................................... 47
12.3.7.3 Operations .............................................................................................................................. 47
12.3.7.4 Conversion rules..................................................................................................................... 47
12.3.7.5 Data access ............................................................................................................................. 48
12.3.7.6 Duration of pinning ................................................................................................................ 48
12.4 Top-level type visibility ...................................................................................................................... 49
13. Variables ..................................................................................................................................................50
14. Conversions..............................................................................................................................................51
14.1 Standard conversions........................................................................................................................... 51
14.1.1 Handle conversions....................................................................................................................... 51
14.1.2 Pointer conversions....................................................................................................................... 51
14.1.3 Lvalue conversions ....................................................................................................................... 51
14.2 Implicit conversions ............................................................................................................................ 51
Table of Contents
v
14.2.1 Implicit constant expression conversions ..................................................................................... 51
14.2.2 User-defined implicit conversions ................................................................................................ 52
14.3 Explicit conversions ............................................................................................................................ 52
14.4 Boxing conversions ............................................................................................................................. 52
14.5 User-defined conversions .................................................................................................................... 53
14.5.1 Constructors.................................................................................................................................. 53
14.5.2 Explicit conversion functions ....................................................................................................... 53
14.5.3 Static conversion functions........................................................................................................... 53
14.6 Parameter array conversions................................................................................................................ 53
14.7 Compiler-defined explicit conversions................................................................................................ 54
14.7.1 Unboxing conversions .................................................................................................................. 54
14.8 Naming conventions............................................................................................................................ 54
14.8.1 CLS-compliant conversion functions ........................................................................................... 55
14.8.2 C++-dependent conversion functions ........................................................................................... 55
15. Expressions .............................................................................................................................................. 56
15.1 Function members ............................................................................................................................... 56
15.2 Primary expressions............................................................................................................................. 56
15.3 Postfix expressions .............................................................................................................................. 56
15.3.1 Subscripting .................................................................................................................................. 57
15.3.2 Indexed access .............................................................................................................................. 57
15.3.3 Function call ................................................................................................................................. 57
15.3.4 Explicit type conversion (functional notation).............................................................................. 58
15.3.5 Pseudo destructor call ................................................................................................................... 58
15.3.6 Class member access..................................................................................................................... 58
15.3.7 Increment and decrement.............................................................................................................. 58
15.3.8 Dynamic cast................................................................................................................................. 58
15.3.9 Type identification........................................................................................................................ 59
15.3.10 Static cast .................................................................................................................................... 60
15.3.11 Reinterpret cast ........................................................................................................................... 61
15.3.12 Const cast.................................................................................................................................... 61
15.3.13 Safe cast ...................................................................................................................................... 61
15.4 Unary expressions ............................................................................................................................... 61
15.4.1 Unary operators............................................................................................................................. 61
15.4.1.1 Unary &.................................................................................................................................. 61
15.4.1.2 Unary *................................................................................................................................... 61
15.4.1.3 Unary % ................................................................................................................................. 62
15.4.1.4 Unary ^................................................................................................................................... 62
15.4.2 Increment and decrement.............................................................................................................. 62
15.4.3 Sizeof ............................................................................................................................................ 62
15.4.4 New............................................................................................................................................... 63
15.4.5 Delete............................................................................................................................................ 63
15.4.6 The gcnew operator....................................................................................................................... 63
15.4.6.1 gcnew Object creation expressions ........................................................................................ 63
15.4.6.2 Array creation expressions ..................................................................................................... 63
15.5 Explicit type conversion (cast notation) .............................................................................................. 63
15.6 Pointer-to-member operators............................................................................................................... 64
15.7 Multiplicative operators....................................................................................................................... 64
15.8 Additive operators ............................................................................................................................... 64
15.8.1 Delegate combination ................................................................................................................... 64
15.8.2 Delegate removal .......................................................................................................................... 64
15.9 Shift operators ..................................................................................................................................... 65
15.10 Relational operators........................................................................................................................... 65
15.11 Equality operators.............................................................................................................................. 65
15.11.1 Ref class equality operators ........................................................................................................ 65
剩余190页未读,继续阅读
资源评论
- zjp80232013-09-15不错 ,企得一看。好好看吧
- xylhh20082013-02-19下载下来看看,挺清楚的反正
- stey_navy2015-06-13正在学习CLI,不过应该有新版了吧
- kingcs10132013-09-01很清楚, 当作参考书查阅。
Suprman
- 粉丝: 854
- 资源: 64
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功