ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf

上传人:diecharacter305 文档编号:1256866 上传时间:2019-09-02 格式:PDF 页数:1376 大小:15.97MB
下载 相关 举报
ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf_第1页
第1页 / 共1376页
ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf_第2页
第2页 / 共1376页
ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf_第3页
第3页 / 共1376页
ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf_第4页
第4页 / 共1376页
ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf_第5页
第5页 / 共1376页
点击查看更多>>
资源描述

1、 Reference number ISO/IEC 14882:2014(E) ISO/IEC 2014INTERNATIONAL STANDARD ISO/IEC 14882 Fourth edition 2014-12-15 Information technology Programming languages C+ Technologies de linformation Langages de programmation C+ ISO/IEC 14882:2014(E) COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2014 All rights rese

2、rved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either IS

3、O at the address below or ISOs member body in the country of the requester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2014 All rights reservedISO/IEC 14882:2014(E) Co

4、ntents Contents iii List of Tables xi List of Figures xv Foreword xvi 1 General 1 1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Normative references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3

5、 Terms and denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Implementation compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.5 Structure of this International Standard . . . . . . . . . . . . . . . . . . . . . . . .

6、 . . . . 5 1.6 Syntax notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.7 The C + memory model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.8 The C + object model . . . . . . . . . . . . . . . . . . . . . . . . . .

7、 . . . . . . . . . . . . 7 1.9 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.10 Multi-threaded executions and data races . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.11 Acknowledgments . . . . . . . . . . . . . . . . . . . .

8、 . . . . . . . . . . . . . . . . . . . . . 15 2 Lexical conventions 16 2.1 Separate translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2 Phases of translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3 Charact

9、er sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.4 Trigraph sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.5 Preprocessing tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10、 . . . . . 19 2.6 Alternative tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.7 Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.8 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . .

11、 . . . . . . . . . . . . . . . . . . 20 2.9 Header names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.10 Preprocessing numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.11 Identiers . . . . . . . . . . . . . .

12、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.12 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.13 Operators and punctuators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.14 Literals . .

13、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3 Basic concepts 32 3.1 Declarations and denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.2 One denition rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14、 . . . . . . . . . . . 34 3.3 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.4 Name lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.5 Program and linkage . . . . . . . . . . . . . . . . .

15、 . . . . . . . . . . . . . . . . . . . . . . 56 3.6 Start and termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 3.7 Storage duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.8 Object lifetime . . . . . . . .

16、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Contents c ISO/IEC 2014 All rights reserved iiiISO/IEC 14882:2014(E) 3.9 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.10 Lvalues and rvalues . . . . . . . . . . . .

17、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.11 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4 Standard conversions 78 4.1 Lvalue-to-rvalue conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18、 79 4.2 Array-to-pointer conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.3 Function-to-pointer conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.4 Qualication conversions . . . . . . . . . . . . . . . . . . . . . . . . . . .

19、 . . . . . . . . . . . 80 4.5 Integral promotions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.6 Floating point promotion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.7 Integral conversions . . . . . . . . . . . . . . . . .

20、 . . . . . . . . . . . . . . . . . . . . . . . 81 4.8 Floating point conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.9 Floating-integral conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.10 Pointer conversions . . . .

21、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.11 Pointer to member conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.12 Boolean conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 4.13 Int

22、eger conversion rank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 5 Expressions 84 5.1 Primary expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.2 Postx expressions . . . . . . . . . . . . . . . . . . . . . . . . . .

23、 . . . . . . . . . . . . . . 97 5.3 Unary expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5.4 Explicit type conversion (cast notation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5.5 Pointer-to-member operators . . . . . . . . .

24、 . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.6 Multiplicative operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.7 Additive operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.8 Shift operators . . .

25、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.9 Relational operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.10 Equality operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

26、21 5.11 Bitwise AND operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.12 Bitwise exclusive OR operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.13 Bitwise inclusive OR operator . . . . . . . . . . . . . . . . . . . . . . .

27、 . . . . . . . . . . . . 122 5.14 Logical AND operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.15 Logical OR operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.16 Conditional operator . . . . . . . . . . . . . .

28、 . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.17 Assignment and compound assignment operators . . . . . . . . . . . . . . . . . . . . . . . . 125 5.18 Comma operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 5.19 Constant expressions . . . .

29、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 6 Statements 130 6.1 Labeled statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 6.2 Expression statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30、 . . 130 6.3 Compound statement or block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 6.4 Selection statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 6.5 Iteration statements . . . . . . . . . . . . . . . . . . . . . . . . .

31、 . . . . . . . . . . . . . . 132 6.6 Jump statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 6.7 Declaration statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 6.8 Ambiguity resolution . . . . . . . . . . . . .

32、 . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 7 Declarations 139 Contents c ISO/IEC 2014 All rights reserved ivISO/IEC 14882:2014(E) 7.1 Speciers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 7.2 Enumeration declarations . . . . . . . .

33、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 7.3 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 7.4 The asm declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 7.5 Linkage specicati

34、ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 7.6 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 8 Declarators 181 8.1 Type names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35、 . . . . . . . . . 182 8.2 Ambiguity resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 8.3 Meaning of declarators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 8.4 Function denitions . . . . . . . . . . . . . . . . . .

36、 . . . . . . . . . . . . . . . . . . . . . . . 196 8.5 Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 9 Classes 214 9.1 Class names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 9.2 Class me

37、mbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 9.3 Member functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 9.4 Static members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38、 . . . . 223 9.5 Unions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 9.6 Bit-elds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 9.7 Nested class declarations . . . . . . . . . . . . . . . . .

39、 . . . . . . . . . . . . . . . . . . . . 227 9.8 Local class declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 9.9 Nested type names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 10 Derived classes 230 10.1 Multiple

40、base classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 10.2 Member name lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 10.3 Virtual functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41、 . . . . 236 10.4 Abstract classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 11 Member access control 242 11.1 Access speciers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 11.2 Accessibility of base classes

42、 and base class members . . . . . . . . . . . . . . . . . . . . . . . 244 11.3 Friends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 11.4 Protected member access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 11.5

43、 Access to virtual functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 11.6 Multiple access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 11.7 Nested classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

44、 . . . . . . . . . . . . 251 12 Special member functions 253 12.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 12.2 Temporary objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 12.3 Conversions .

45、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 12.4 Destructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 12.5 Free store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46、 . . . . . 263 12.6 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 12.7 Construction and destruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 12.8 Copying and moving class objects . . . . . . . . . . . . .

47、 . . . . . . . . . . . . . . . . . . . . 273 12.9 Inheriting constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 Contents c ISO/IEC 2014 All rights reserved vISO/IEC 14882:2014(E) 13 Overloading 284 13.1 Overloadable declarations . . . . . . . . . . . . . .

48、 . . . . . . . . . . . . . . . . . . . . . . . 284 13.2 Declaration matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 13.3 Overload resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 13.4 Address of overloaded f

49、unction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 13.5 Overloaded operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 13.6 Built-in operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 14 Templates 316 14.1 Template parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 14.2 Names of template specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 14.3 Template ar

展开阅读全文
相关资源
猜你喜欢
  • EN 319-1993 en Particleboards and Fibreboards - Determination of Tensile Strength Perpendicular to the Plane of the Board《刨花板和纤维板 与板平面垂直的拉伸强度的测定》.pdf EN 319-1993 en Particleboards and Fibreboards - Determination of Tensile Strength Perpendicular to the Plane of the Board《刨花板和纤维板 与板平面垂直的拉伸强度的测定》.pdf
  • EN 3196-1994 en Aerospace Series Nuts Hexagonal Self-Locking in Heat Resisting Steel FE-PA92HT (A286) Silver Plated Classification 1100 MPa (at Ambient Temperature) 425 Degrees Cel.pdf EN 3196-1994 en Aerospace Series Nuts Hexagonal Self-Locking in Heat Resisting Steel FE-PA92HT (A286) Silver Plated Classification 1100 MPa (at Ambient Temperature) 425 Degrees Cel.pdf
  • EN 3197-2010 en Aerospace series - Design and installation of aircraft electrical and optical interconnection systems《航空航天系列 设计和安装飞机电气和光学互连系统》.pdf EN 3197-2010 en Aerospace series - Design and installation of aircraft electrical and optical interconnection systems《航空航天系列 设计和安装飞机电气和光学互连系统》.pdf
  • EN 320-2011 en Particleboards and fibreboards - Determination of resistance to axial withdrawal of screws《纤维板 螺钉轴向拔出力测定》.pdf EN 320-2011 en Particleboards and fibreboards - Determination of resistance to axial withdrawal of screws《纤维板 螺钉轴向拔出力测定》.pdf
  • EN 3201-2008 en Aerospace series - Holes for metric threaded fasteners - Design standard《航空航天系列 米制螺纹紧固件的孔 设计标准》.pdf EN 3201-2008 en Aerospace series - Holes for metric threaded fasteners - Design standard《航空航天系列 米制螺纹紧固件的孔 设计标准》.pdf
  • EN 3202-1995 en Aerospace Series - Holes and Traps for T-Head Bolts - Design Standard《航空航天系列 T形头螺栓的孔和阱 设计标准》.pdf EN 3202-1995 en Aerospace Series - Holes and Traps for T-Head Bolts - Design Standard《航空航天系列 T形头螺栓的孔和阱 设计标准》.pdf
  • EN 3207-1998 en Aerospace Series - Rubber Compounds - Technical Specification《航空航天系列 橡胶化合物 技术规范》.pdf EN 3207-1998 en Aerospace Series - Rubber Compounds - Technical Specification《航空航天系列 橡胶化合物 技术规范》.pdf
  • EN 321-2001 en Wood-Based Panels - Determination of Moisture Resistance under Cyclic Test Conditions《木基板 循环试验条件下抗潮湿性的测定》.pdf EN 321-2001 en Wood-Based Panels - Determination of Moisture Resistance under Cyclic Test Conditions《木基板 循环试验条件下抗潮湿性的测定》.pdf
  • EN 3212-1995 en Aerospace Series - Paints and Varnishes - Corrosion Test by Alternate Immersion in a Buffered Sodium Chloride Solution《航空航天系列 油漆和清漆 在缓冲氯化纳溶剂中用更换浸渍试验测定耐蚀性》.pdf EN 3212-1995 en Aerospace Series - Paints and Varnishes - Corrosion Test by Alternate Immersion in a Buffered Sodium Chloride Solution《航空航天系列 油漆和清漆 在缓冲氯化纳溶剂中用更换浸渍试验测定耐蚀性》.pdf
  • 相关搜索
    资源标签

    当前位置:首页 > 标准规范 > 国际标准 > 其他

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1