ISO IEC 14882 2003 (C++03)

VIP免费
2025-02-27 0 0 2.35MB 786 页 5.9玖币
侵权投诉
B CReference numbe
r
ISO/IEC 14882:2003(E)
INTERNATIONAL
STANDARD ISO/IEC
14882
Second edition
2003-10-15
Programming languages — C++
Langages de programmation — C++
Adopted by INCITS (InterNational Committee for Information Technology Standards) as an American National Standard.
Date of ANSI Approval: 12/29/2003
Published by American National Standards Institute,
25 West 43rd Street, New York, New York 10036
Copyright 2003 by Information Technology Industry Council (ITI).
All rights reserved.
These materials are subject to copyright claims of International Standardization Organization (ISO), International
Electrotechnical Commission (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, without
the prior written permission of ITI. All requests pertaining to this standard should be submitted to ITI, 1250 Eye Street NW,
Washington, DC 20005.
Printed in the United States of America
© ISO/IEC 2003
ISO/IEC 14882:2003(E)
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless 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 Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of 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 unlikely 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 photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's 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 copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO/IEC 2003All rights reserved
ISO/IEC 14882:2003(E)
© ISO/IEC 2003 — All rights reserved iii
Contents
1 General ........................................................................................................................................................1
1.1 Scope........................................................................................................................................................1
1.2 Normative references ...............................................................................................................................1
1.3 Terms and definitions .........................................................................................................................................1
1.3.1 argument ...............................................................................................................................................1
1.3.2 diagnostic message ...............................................................................................................................2
1.3.3 dynamic type .........................................................................................................................................2
1.3.4 ill-formed program................................................................................................................................2
1.3.5 implementation-defined behavior .........................................................................................................2
1.3.6 implementation limits ...........................................................................................................................2
1.3.7 locale-specific behavior ........................................................................................................................2
1.3.8 multibyte character ...............................................................................................................................2
1.3.9 parameter ..............................................................................................................................................2
1.3.10 signature ..............................................................................................................................................2
1.3.11 static type ............................................................................................................................................2
1.3.12 undefined behavior .............................................................................................................................2
1.3.13 unspecified behavior ...........................................................................................................................3
1.3.14 well-formed program ..........................................................................................................................3
1.4 Implementation compliance.....................................................................................................................3
1.5 Structure of this International Standard ...................................................................................................4
1.6 Syntax notation ........................................................................................................................................4
1.7 The C + + memory model ...........................................................................................................................4
1.8 The C + + object model ..............................................................................................................................4
1.9 Program execution ...................................................................................................................................5
ISO/IEC 14882:2003(E)
iv © ISO/IEC 2003 — All rights reserved
1.10 Acknowledgments .................................................................................................................................8
2 Lexical conventions ....................................................................................................................................9
2.1 Phases of translation ................................................................................................................................9
2.2 Character sets .........................................................................................................................................10
2.3 Trigraph sequences ................................................................................................................................11
2.4 Preprocessing tokens .............................................................................................................................11
2.5 Alternative tokens ..................................................................................................................................12
2.6 Tokens....................................................................................................................................................12
2.7 Comments ..............................................................................................................................................12
2.8 Header names .........................................................................................................................................13
2.9 Preprocessing numbers ..........................................................................................................................13
2.10 Identifiers .............................................................................................................................................13
2.11 Keywords .............................................................................................................................................14
2.12 Operators and punctuators ...................................................................................................................15
2.13 Literals .................................................................................................................................................15
2.13.1 Integer literals ...................................................................................................................................15
2.13.2 Character literals ...............................................................................................................................16
2.13.3 Floating literals .................................................................................................................................18
2.13.4 String literals .....................................................................................................................................19
2.13.5 Boolean literals .................................................................................................................................19
3 Basic concepts ..........................................................................................................................................21
3.1 Declarations and definitions ..................................................................................................................21
3.2 One definition rule .................................................................................................................................22
3.3 Declarative regions and scopes ..............................................................................................................24
3.3.1 Point of declaration .............................................................................................................................25
3.3.2 Local scope .........................................................................................................................................26
3.3.3 Function prototype scope ....................................................................................................................26
3.3.4 Function scope ....................................................................................................................................27
3.3.5 Namespace scope ................................................................................................................................27
3.3.6 Class scope..........................................................................................................................................27
3.3.7 Name hiding........................................................................................................................................28
3.4 Name lookup ..........................................................................................................................................29
3.4.1 Unqualified name lookup ...................................................................................................................29
3.4.2 Argument-dependent name lookup .....................................................................................................32
3.4.3 Qualified name lookup .......................................................................................................................34
ISO/IEC 14882:2003(E)
© ISO/IEC 2003 — All rights reserved v
3.4.3.1 Class members .................................................................................................................................35
3.4.3.2 Namespace members .......................................................................................................................35
3.4.4 Elaborated type specifiers ...................................................................................................................39
3.4.5 Class member access ..........................................................................................................................40
3.4.6 Using-directives and namespace aliases .............................................................................................41
3.5 Program and linkage ..............................................................................................................................41
3.6 Start and termination..............................................................................................................................43
3.6.1 Main function......................................................................................................................................43
3.6.2 Initialization of non-local objects .......................................................................................................44
3.6.3 Termination.........................................................................................................................................45
3.7 Storage duration .....................................................................................................................................46
3.7.1 Static storage duration ........................................................................................................................46
3.7.2 Automatic storage duration.................................................................................................................46
3.7.3 Dynamic storage duration ...................................................................................................................47
3.7.3.1 Allocation functions.........................................................................................................................47
3.7.3.2 Deallocation functions .....................................................................................................................48
3.7.4 Duration of sub-objects.......................................................................................................................48
3.8 Object Lifetime ......................................................................................................................................49
3.9 Types......................................................................................................................................................52
3.9.1 Fundamental types ..............................................................................................................................53
3.9.2 Compound types .................................................................................................................................55
3.9.3 CV-qualifiers ......................................................................................................................................55
3.10 Lvalues and rvalues .............................................................................................................................56
4 Standard conversions ................................................................................................................................59
4.1 Lvalue-to-rvalue conversion ..................................................................................................................59
4.2 Array-to-pointer conversion ..................................................................................................................60
4.3 Function-to-pointer conversion .............................................................................................................60
4.4 Qualification conversions ......................................................................................................................60
4.5 Integral promotions ................................................................................................................................61
4.6 Floating point promotion .......................................................................................................................61
4.7 Integral conversions ...............................................................................................................................62
4.8 Floating point conversions .....................................................................................................................62
4.9 Floating-integral conversions ................................................................................................................62
4.10 Pointer conversions ..............................................................................................................................62
4.11 Pointer to member conversions ...........................................................................................................63
摘要:

BCReferencenumberISO/IEC14882:2003(E)INTERNATIONALSTANDARDISO/IEC14882Secondedition2003-10-15Programminglanguages—C++Langagesdeprogrammation—C++AdoptedbyINCITS(InterNationalCommitteeforInformationTechnologyS andards)asanAmericanNationalStandard.DateofANSIApproval:12/29/2003PublishedbyAmericanNation...

展开>> 收起<<
ISO IEC 14882 2003 (C++03).pdf

共786页,预览5页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:计算机 价格:5.9玖币 属性:786 页 大小:2.35MB 格式:PDF 时间:2025-02-27

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 786
客服
关注