(标准规范)ISO-IEC-14882-2003-(C++03).pdf

上传人:君**** 文档编号:93096330 上传时间:2023-06-28 格式:PDF 页数:786 大小:2.70MB
返回 下载 相关 举报
(标准规范)ISO-IEC-14882-2003-(C++03).pdf_第1页
第1页 / 共786页
(标准规范)ISO-IEC-14882-2003-(C++03).pdf_第2页
第2页 / 共786页
点击查看更多>>
资源描述

《(标准规范)ISO-IEC-14882-2003-(C++03).pdf》由会员分享,可在线阅读,更多相关《(标准规范)ISO-IEC-14882-2003-(C++03).pdf(786页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、BCReferencenumbe rISO/IEC14882:2003(E)INTERNATIONALSTANDARDISO/IEC14882Secondedition20031015ProgramminglanguagesC+LangagesdeprogrammationC+Adopted by INCITS(InterNational Committee for Information Technology Standards)as an American National Standard.Date of ANSI Approval:12/29/2003Published by Amer

2、ican National Standards Institute,25 West 43rd Street,New York,New York 10036Copyright 2003 by Information Technology Industry Council(ITI).All rights reserved.These materials are subject to copyright claims of International Standardization Organization(ISO),InternationalElectrotechnical Commission(

3、IEC),American National Standards Institute(ANSI),and Information Technology Industry Council(ITI).Not for resale.No part of this publication may be reproduced in any form,including an electronic retrieval system,withoutthe prior written permission of ITI.All requests pertaining to this standard shou

4、ld be submitted to ITI,1250 Eye Street NW,Washington,DC 20005.Printed in the United States of America第 1 页 共 786 页ISO/IEC 14882:2003(E)PDF disclaimer This PDF file may contain embedded typefaces.In accordance with Adobes licensing policy,this file may be printed or viewed but shall not be edited unl

5、ess the typefaces which are embedded are licensed to and installed on the computer performing the editing.In downloading this file,parties accept therein the responsibility of not infringing Adobes licensing policy.The ISO Central Secretariat accepts no liability in this area.Adobe is a trademark of

6、 Adobe Systems Incorporated.Details of the software products used to create this PDF file can be found in the General Info relative to the file;the PDF-creation parameters were optimized for printing.Every care has been taken to ensure that the file is suitable for use by ISO member bodies.In the un

7、likely event that a problem relating to it is found,please inform the Central Secretariat at the address given below.ISO/IEC 2003 All rights reserved.Unless otherwise specified,no part of this publication may be reproduced or utilized in any form or by any means,electronic or mechanical,including ph

8、otocopying and microfilm,without permission in writing from either ISO 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 Switzer

9、land ii ISO/IEC 2003 All rights reserved 第 2 页 共 786 页ISO/IEC 14882:2003(E)ISO/IEC 2003 All rights reserved iii Contents1 General.11.1 Scope.11.2 Normative references.11.3 Terms and definitions.11.3.1 argument.11.3.2 diagnostic message.21.3.3 dynamic type.21.3.4 ill-formed program.21.3.5 implementat

10、ion-defined behavior.21.3.6 implementation limits.21.3.7 locale-specific behavior.21.3.8 multibyte character.21.3.9 parameter.21.3.10 signature.21.3.11 static type.21.3.12 undefined behavior.21.3.13 unspecified behavior.31.3.14 well-formed program.31.4 Implementation compliance.31.5 Structure of thi

11、s International Standard.41.6 Syntax notation.41.7 The C+memory model.41.8 The C+object model.41.9 Program execution.5第 3 页 共 786 页ISO/IEC 14882:2003(E)iv ISO/IEC 2003 All rights reserved 1.10 Acknowledgments.82 Lexical conventions.92.1 Phases of translation.92.2 Character sets.102.3 Trigraph sequen

12、ces.112.4 Preprocessing tokens.112.5 Alternative tokens.122.6 Tokens.122.7 Comments.122.8 Header names.132.9 Preprocessing numbers.132.10 Identifiers.132.11 Keywords.142.12 Operators and punctuators.152.13 Literals.152.13.1 Integer literals.152.13.2 Character literals.162.13.3 Floating literals.182.

13、13.4 String literals.192.13.5 Boolean literals.193 Basic concepts.213.1 Declarations and definitions.213.2 One definition rule.223.3 Declarative regions and scopes.243.3.1 Point of declaration.253.3.2 Local scope.263.3.3 Function prototype scope.263.3.4 Function scope.273.3.5 Namespace scope.273.3.6

14、 Class scope.273.3.7 Name hiding.283.4 Name lookup.293.4.1 Unqualified name lookup.293.4.2 Argument-dependent name lookup.323.4.3 Qualified name lookup.34第 4 页 共 786 页ISO/IEC 14882:2003(E)ISO/IEC 2003 All rights reserved v 3.4.3.1 Class members.353.4.3.2 Namespace members.353.4.4 Elaborated type spe

15、cifiers.393.4.5 Class member access.403.4.6 Using-directives and namespace aliases.413.5 Program and linkage.413.6 Start and termination.433.6.1 Main function.433.6.2 Initialization of non-local objects.443.6.3 Termination.453.7 Storage duration.463.7.1 Static storage duration.463.7.2 Automatic stor

16、age duration.463.7.3 Dynamic storage duration.473.7.3.1 Allocation functions.473.7.3.2 Deallocation functions.483.7.4 Duration of sub-objects.483.8 Object Lifetime.493.9 Types.523.9.1 Fundamental types.533.9.2 Compound types.553.9.3 CV-qualifiers.553.10 Lvalues and rvalues.564 Standard conversions.5

17、94.1 Lvalue-to-rvalue conversion.594.2 Array-to-pointer conversion.604.3 Function-to-pointer conversion.604.4 Qualification conversions.604.5 Integral promotions.614.6 Floating point promotion.614.7 Integral conversions.624.8 Floating point conversions.624.9 Floating-integral conversions.624.10 Poin

18、ter conversions.624.11 Pointer to member conversions.63第 5 页 共 786 页ISO/IEC 14882:2003(E)vi ISO/IEC 2003 All rights reserved 4.12 Boolean conversions.635 Expressions.655.1 Primary expressions.665.2 Postfix expressions.685.2.1 Subscripting.685.2.2 Function call.685.2.3 Explicit type conversion(functi

19、onal notation).705.2.4 Pseudo destructor call.705.2.5 Class member access.705.2.6 Increment and decrement.715.2.7 Dynamic cast.725.2.8 Type identification.735.2.9 Static cast.745.2.10 Reinterpret cast.755.2.11 Const cast.765.3 Unary expressions.785.3.1 Unary operators.785.3.2 Increment and decrement

20、.795.3.3 Sizeof.795.3.4 New.805.3.5 Delete.835.4 Explicit type conversion(cast notation).845.5 Pointer-to-member operators.855.6 Multiplicative operators.855.7 Additive operators.865.8 Shift operators.875.9 Relational operators.875.10 Equality operators.885.11 Bitwise AND operator.895.12 Bitwise exc

21、lusive OR operator.895.13 Bitwise inclusive OR operator.895.14 Logical AND operator.895.15 Logical OR operator.905.16 Conditional operator.905.17 Assignment operators.91第 6 页 共 786 页ISO/IEC 14882:2003(E)ISO/IEC 2003 All rights reserved vii 5.18 Comma operator.925.19 Constant expressions.926 Statemen

22、ts.956.1 Labeled statement.956.2 Expression statement.956.3 Compound statement or block.956.4 Selection statements.966.4.1 Theif statement.976.4.2 Theswitch statement.976.5 Iteration statements.976.5.1 Thewhile statement.986.5.2 Thedo statement.986.5.3 Thefor statement.996.6 Jump statements.996.6.1

23、Thebreak statement.996.6.2 Thecontinue statement.1006.6.3 Thereturn statement.1006.6.4 Thegoto statement.1006.7 Declaration statement.1006.8 Ambiguity resolution.1017 Declarations.1037.1 Specifiers.1047.1.1 Storage class specifiers.1057.1.2 Function specifiers.1067.1.3 Thetypedef specifier.1077.1.4

24、Thefriend specifier.1087.1.5 Type specifiers.1087.1.5.1 The cv-qualifiers.1097.1.5.2 Simple type specifiers.1107.1.5.3 Elaborated type specifiers.1117.2 Enumeration declarations.1127.3 Namespaces.1147.3.1 Namespace definition.1147.3.1.1 Unnamed namespaces.1157.3.1.2 Namespace member definitions.1157

25、.3.2 Namespace alias.1177.3.3 Theusing declaration.1177.3.4 Using directive.1237.4 Theasm declaration.126第 7 页 共 786 页ISO/IEC 14882:2003(E)viii ISO/IEC 2003 All rights reserved 7.5 Linkage specifications.1268 Declarators.1318.1 Type names.1328.2 Ambiguity resolution.1328.3 Meaning of declarators.134

26、8.3.1 Pointers.1358.3.2 References.1358.3.3 Pointers to members.1368.3.4 Arrays.1378.3.5 Functions.1388.3.6 Default arguments.1418.4 Function definitions.1448.5 Initializers.1458.5.1 Aggregates.1478.5.2 Character arrays.1508.5.3 References.1509 Classes.1539.1 Class names.1539.2 Class members.1559.3

27、Member functions.1579.3.1 Nonstatic member functions.1589.3.2 Thethis pointer.1609.4 Static members.1609.4.1 Static member functions.1619.4.2 Static data members.1619.5 Unions.1629.6 Bit-fields.1639.7 Nested class declarations.1649.8 Local class declarations.1659.9 Nested type names.16610 Derived cl

28、asses.16710.1 Multiple base classes.16810.2 Member name lookup.16910.3 Virtual functions.172第 8 页 共 786 页ISO/IEC 14882:2003(E)ISO/IEC 2003 All rights reserved ix 10.4 Abstract classes.17611 Member access control.17911.1 Access specifiers.18011.2 Accessibility of base classes and base class members.1

29、8111.3 Access declarations.18211.4 Friends.18311.5 Protected member access.18611.6 Access to virtual functions.18711.7 Multiple access.18811.8 Nested classes.18812 Special member functions.18912.1 Constructors.18912.2 Temporary objects.19112.3 Conversions.19212.3.1 Conversion by constructor.19312.3.

30、2 Conversion functions.19412.4 Destructors.19512.5 Free store.19812.6 Initialization.19912.6.1 Explicit initialization.20012.6.2 Initializing bases and members.20112.7 Construction and destruction.20412.8 Copying class objects.20713 Overloading.21313.1 Overloadable declarations.21313.2 Declaration m

31、atching.21513.3 Overload resolution.21613.3.1 Candidate functions and argument lists.21713.3.1.1 Function call syntax.21813.3.1.1.1 Call to named function.21813.3.1.1.2 Call to object of class type.21913.3.1.2 Operators in expressions.220第 9 页 共 786 页ISO/IEC 14882:2003(E)x ISO/IEC 2003 All rights re

32、served 13.3.1.3 Initialization by constructor.22213.3.1.4 Copy-initialization of class by user-defined conversion.22213.3.1.5 Initialization by conversion function.22213.3.1.6 Initialization by conversion function for direct reference binding.22313.3.2 Viable functions.22313.3.3 Best Viable Function

33、.22313.3.3.1 Implicit conversion sequences.22513.3.3.1.1 Standard conversion sequences.22713.3.3.1.2 User-defined conversion sequences.22713.3.3.1.3 Ellipsis conversion sequences.22813.3.3.1.4 Reference binding.22813.3.3.2 Ranking implicit conversion sequences.22813.4 Address of overloaded function.

34、23013.5 Overloaded operators.23213.5.1 Unary operators.23313.5.2 Binary operators.23313.5.3 Assignment.23313.5.4 Function call.23413.5.5 Subscripting.23413.5.6 Class member access.23413.5.7 Increment and decrement.23413.6 Built-in operators.23514 Templates.23914.1 Template parameters.24014.2 Names o

35、f template specializations.24214.3 Template arguments.24414.3.1 Template type arguments.24514.3.2 Template non-type arguments.24614.3.3 Template template arguments.24814.4 Type equivalence.24814.5 Template declarations.24914.5.1 Class templates.24914.5.1.1 Member functions of class templates.24914.5

36、.1.2 Member classes of class templates.25014.5.1.3 Static data members of class templates.25014.5.2 Member templates.25114.5.3 Friends.25214.5.4 Class template partial specializations.25414.5.4.1 Matching of class template partial specializations.25614.5.4.2 Partial ordering of class template specia

37、lizations.25714.5.4.3 Members of class template specializations.25714.5.5 Function templates.25814.5.5.1 Function template overloading.25914.5.5.2 Partial ordering of function templates.260第 10 页 共 786 页ISO/IEC 14882:2003(E)ISO/IEC 2003 All rights reserved xi 14.6 Name resolution.26114.6.1 Locally d

38、eclared names.26414.6.2 Dependent names.26714.6.2.1 Dependent types.26814.6.2.2 Type-dependent expressions.26814.6.2.3 Value-dependent expressions.26914.6.2.4 Dependent template arguments.26914.6.3 Non-dependent names.27014.6.4 Dependent name resolution.27014.6.4.1 Point of instantiation.27014.6.4.2

39、 Candidate functions.27114.6.5 Friend names declared within a class template.27114.7 Template instantiation and specialization.27214.7.1 Implicit instantiation.27314.7.2 Explicit instantiation.27614.7.3 Explicit specialization.27714.8 Function template specializations.28214.8.1 Explicit template arg

40、ument specification.28314.8.2 Template argument deduction.28514.8.2.1 Deducing template arguments from a function call.28714.8.2.2 Deducing template arguments taking the address of a function template.28814.8.2.3 Deducing conversion function template arguments.28814.8.2.4 Deducing template arguments

41、 from a type.28814.8.3 Overload resolution.29315 Exception handling.29715.1 Throwing an exception.29815.2 Constructors and destructors.30015.3 Handling an exception.30015.4 Exception specifications.30215.5 Special functions.30415.5.1 Theterminate()function.30415.5.2 Theunexpected()function.30515.5.3

42、 Theuncaught_exception()function.30515.6 Exceptions and access.30516 Preprocessing directives.30716.1 Conditional inclusion.30816.2 Source file inclusion.30916.3 Macro replacement.31016.3.1 Argument substitution.31116.3.2 The#operator.31116.3.3 The#operator.312第 11 页 共 786 页ISO/IEC 14882:2003(E)xii

43、ISO/IEC 2003 All rights reserved 16.3.4 Rescanning and further replacement.31216.3.5 Scope of macro definitions.31216.4 Line control.31416.5 Error directive.31416.6 Pragma directive.31416.7 Null directive.31416.8 Predefined macro names.31517 Library introduction.31717.1 Definitions.31717.1.1 arbitra

44、ry-positional stream.31717.1.2 character.31717.1.3 character container type.31717.1.4 comparison function.31717.1.5 component.31817.1.6 default behavior.31817.1.7 handler function.31817.1.8 iostream class templates.31817.1.9 modifier function.31817.1.10 object state.31817.1.11 narrow-oriented iostre

45、am classes.31817.1.12 NTCTS.31817.1.13 observer function.31817.1.14 replacement function.31817.1.15 required behavior.31817.1.16 repositional stream.31917.1.17 reserved function.31917.1.18 traits class.31917.1.19 wide-oriented iostream classes.31917.2 Additional definitions.31917.3 Method of descrip

46、tion(Informative).31917.3.1 Structure of each subclause.31917.3.1.1 Summary.32017.3.1.2 Requirements.32017.3.1.3 Specifications.32017.3.1.4 C Library.32117.3.2 Other conventions.32117.3.2.1 Type descriptions.32117.3.2.1.1 Enumerated types.32217.3.2.1.2 Bitmask types.32217.3.2.1.3 Character sequences

47、.32317.3.2.1.3.1 Byte strings.32317.3.2.1.3.2 Multibyte strings.32417.3.2.1.3.3 Wide-character sequences.32417.3.2.2 Functions within classes.32417.3.2.3 Private members.324第 12 页 共 786 页ISO/IEC 14882:2003(E)ISO/IEC 2003 All rights reserved xiii 17.4 Library-wide requirements.32417.4.1 Library conte

48、nts and organization.32517.4.1.1 Library contents.32517.4.1.2 Headers.32517.4.1.3 Freestanding implementations.32617.4.2 Using the library.32617.4.2.1 Headers.32617.4.2.2 Linkage.32717.4.3 Constraints on programs.32717.4.3.1 Reserved names.32717.4.3.1.1 Macro names.32717.4.3.1.2 Global names.32717.4

49、.3.1.3 External linkage.32817.4.3.1.4 Types.32817.4.3.2 Headers.32817.4.3.3 Derived classes.32817.4.3.4 Replacement functions.32817.4.3.5 Handler functions.32917.4.3.6 Other functions.32917.4.3.7 Function arguments.33017.4.3.8 Required paragraph.33017.4.4 Conforming implementations.33017.4.4.1 Heade

50、rs.33017.4.4.2 Restrictions on macro definitions.33017.4.4.3 Global or non-member functions.33017.4.4.4 Member functions.33117.4.4.5 Reentrancy.33117.4.4.6 Protection within classes.33117.4.4.7 Derived classes.33117.4.4.8 Restrictions on exception handling.33118 Language support library.33318.1 Type

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 标准材料 > 建筑材料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com