欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PDF文档下载
    分享到微信 分享到微博 分享到QQ空间

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

    • 资源ID:1256866       资源大小:15.97MB        全文页数:1376页
    • 资源格式: PDF        下载积分:10000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要10000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

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

    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


    注意事项

    本文(ISO IEC 14882-2014 Information technology - Programming languages - C++《信息技术 编程语言 C++》.pdf)为本站会员(diecharacter305)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

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

    收起
    展开