Download Complete ISO IEC 14882 2020 Information technology Programming languages C 6th Edition Iso PDF for All Chapters
Download Complete ISO IEC 14882 2020 Information technology Programming languages C 6th Edition Iso PDF for All Chapters
com
https://ebookmeta.com/product/iso-
iec-14882-2020-information-technology-programming-
languages-c-6th-edition-iso/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/urinary-biomarkers-1st-edition-samanta-
salvi-valentina-casadio/
ebookmeta.com
Dictionary of Daily Life in Biblical Post Biblical
Antiquity Literacy Edwin M Yamauchi Marvin R Wilson
https://ebookmeta.com/product/dictionary-of-daily-life-in-biblical-
post-biblical-antiquity-literacy-edwin-m-yamauchi-marvin-r-wilson/
ebookmeta.com
https://ebookmeta.com/product/the-little-penguin-margo-gates/
ebookmeta.com
https://ebookmeta.com/product/chemical-reaction-engineering-parameter-
estimation-exercises-and-examples-second-edition-martin-schmal/
ebookmeta.com
The Evolutionary Biology of Extinct and Extant Organisms
1st Edition Kundu
https://ebookmeta.com/product/the-evolutionary-biology-of-extinct-and-
extant-organisms-1st-edition-kundu/
ebookmeta.com
INTERNATIONAL ISO/IEC
STANDARD 14882
Sixth edition
2020-12
Reference number
ISO/IEC 14882:2020(E)
© ISO/IEC 2020
Contents
Foreword x
1 Scope 1
2 Normative references 2
4 General principles 9
4.1 Implementation compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Structure of this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3 Syntax notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Lexical conventions 12
5.1 Separate translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2 Phases of translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3 Character sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4 Preprocessing tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.5 Alternative tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.6 Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.7 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.8 Header names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.9 Preprocessing numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.10 Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.11 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.12 Operators and punctuators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.13 Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6 Basics 28
6.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2 Declarations and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.3 One-definition rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.4 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.5 Name lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.6 Program and linkage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.7 Memory and objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.8 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.9 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7 Expressions 90
7.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.2 Properties of expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.3 Standard conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
7.4 Usual arithmetic conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.5 Primary expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.6 Compound expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7.7 Constant expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
8 Statements 153
8.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
8.2 Labeled statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
8.3 Expression statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
8.4 Compound statement or block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
8.5 Selection statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
9 Declarations 163
9.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
9.2 Specifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
9.3 Declarators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
9.4 Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.5 Function definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
9.6 Structured binding declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
9.7 Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
9.8 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
9.9 The using declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
9.10 The asm declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
9.11 Linkage specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
9.12 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
10 Modules 247
10.1 Module units and purviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
10.2 Export declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
10.3 Import declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
10.4 Global module fragment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
10.5 Private module fragment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
10.6 Instantiation context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
10.7 Reachability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
11 Classes 258
11.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
11.2 Properties of classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
11.3 Class names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
11.4 Class members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
11.5 Unions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
11.6 Local class declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
11.7 Derived classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
11.8 Member name lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
11.9 Member access control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
11.10 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
11.11 Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
11.12 Free store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
12 Overloading 324
12.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
12.2 Overloadable declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
12.3 Declaration matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
12.4 Overload resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
12.5 Address of overloaded function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
12.6 Overloaded operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
12.7 Built-in operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
12.8 User-defined literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
13 Templates 360
13.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
13.2 Template parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
13.3 Names of template specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
13.4 Template arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
13.5 Template constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
13.6 Type equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Bibliography 1706
Index 1734
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are members
of ISO or IEC participate in the development of International Standards through technical committees
established by the respective organization to deal with particular fields of technical activity. ISO and IEC
technical committees collaborate in fields of mutual interest. Other international organizations, governmental
and non-governmental, in liaison with ISO and IEC, also take part in the work.
The procedures used to develop this document and those intended for its further maintenance are described in
the ISO/IEC Directives, Part 1. In particular the different approval criteria needed for the different types of
document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC
Directives, Part 2 (see www.iso.org/directives).
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent
rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details of any
patent rights identified during the development of the document will be in the Introduction and/or on the
ISO list of patent declarations received (see www.iso.org/patents) or the IEC list of patent declarations
received (see http://patents.iec.ch).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation on the voluntary nature of standards, the meaning of ISO specific terms and expressions re-
lated to conformity assessment, as well as information about ISO’s adherence to the World Trade Organization
(WTO) principles in the Technical Barriers to Trade (TBT), see www.iso.org/iso/foreword.html.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 22, Programming languages, their environments and system software interfaces.
This sixth edition cancels and replaces the fifth edition (ISO/IEC 14882:2017), which has been technically
revised.
The main changes compared to the previous edition are as follows:
— inclusion of the provisions of ISO/IEC TS 19217:2015, ISO/IEC TS 21425:2017, ISO/IEC TS 22277:2017,
ISO/IEC TS 21544:2018, portions of ISO/IEC TS 19571:2016, and portions of ISO/IEC TS 19568:2017.
— addition of concepts, requires-clauses, requires-expressions, and <concepts> (18.3) header
— addition of coroutines, including co_yield, co_await, and co_return keywords and <coroutine>
(17.12.2) header
— addition of modules, import-declarations, and export-declarations
— addition of three-way comparison, defaulted comparisons, rewriting of comparison operator expressions,
and <compare> (17.11.1) header
— addition of designated initializers
— support for class types and floating-point types as the type of a non-type template parameter
— new attributes [[no_unique_address]], [[likely]], [[unlikely]]
— support for optional reason string in [[nodiscard]] attribute
— ability to require constant initialization with constinit keyword
— ability to require constant evaluation with consteval keyword
— extensions to constant evaluation
— support for controlling destruction in a class-specific operator delete function
— addition of using enum declaration
— addition of char8_t type
— support for an initializer statement in range-based for loops
1 Scope [intro.scope]
1 This document specifies requirements for implementations of the C++ programming language. The first such
requirement is that they implement the language, so this document also defines C++. Other requirements
and relaxations of the first requirement appear at various places within this document.
2 C++ is a general purpose programming language based on the C programming language as described in
ISO/IEC 9899:2018 Programming languages — C (hereinafter referred to as the C standard). C++ provides
many facilities beyond those provided by C, including additional data types, classes, templates, exceptions,
namespaces, operator overloading, function name overloading, references, free store management operators,
and additional library facilities.
1) POSIX® is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc. This information is given for
the convenience of users of this document and does not constitute an endorsement by ISO or IEC of this product.
2) Cancelled and replaced by ISO/IEC 10646:2017.
3) ECMAScript® is a registered trademark of Ecma International. This information is given for the convenience of users of
this document and does not constitute an endorsement by ISO or IEC of this product.
4) With the qualifications noted in Clause 17 through Clause 32 and in C.6, the C standard library is a subset of the C++
standard library.
3.1 [defns.access]
access
〈execution-time action〉 read or modify the value of an object
[Note 1 to entry: Only objects of scalar type can be accessed. Reads of scalar objects are described in 7.3.2 and
modifications of scalar objects are describred in 7.6.19, 7.6.1.6, and 7.6.2.3. Attempts to read or modify an object of
class type typically invoke a constructor (11.4.5) or assignment operator (11.4.6); such invocations do not themselves
constitute accesses, although they may involve accesses of scalar subobjects. — end note]
3.2 [defns.arbitrary.stream]
arbitrary-positional stream
〈library〉 stream that can seek to any integral position within the length of the stream
[Note 1 to entry: Every arbitrary-positional stream is also a repositional stream (3.42). — end note]
3.3 [defns.argument]
argument
〈function call expression〉 expression in the comma-separated list bounded by the parentheses
3.4 [defns.argument.macro]
argument
〈function-like macro〉 sequence of preprocessing tokens in the comma-separated list bounded by the parentheses
3.5 [defns.argument.throw]
argument
〈throw expression〉 operand of throw
3.6 [defns.argument.templ]
argument
〈template instantiation〉 constant-expression, type-id, or id-expression in the comma-separated list bounded by
the angle brackets
3.7 [defns.block]
block
〈execution〉 wait for some condition (other than for the implementation to execute the execution steps of the
thread of execution) to be satisfied before continuing execution past the blocking operation
3.8 [defns.block.stmt]
block
〈statement〉 compound statement
3.9 [defns.character]
character
〈library〉 object which, when treated sequentially, can represent text
[Note 1 to entry: The term does not mean only char, char8_t, char16_t, char32_t, and wchar_t objects (6.8.2), but
any value that can be represented by a type that provides the definitions specified in Clause 21, Clause 28, Clause 29,
or Clause 30. — end note]
FRAPPIER’S
BARBER SHOP
100 per cent. CLEAN
Manicure Shoe Shine
211 ELM STREET
Next to Gym.
Vesta
STORAGE BATTERY
VESTA BATTERY CORPORATION
CHICAGO
$1195
f.o.b. factory
NASH
The introduction by Nash of this new Four Sport car can be
termed with justice a notable event.
For here is a car of moderate price whose appeal to your sense of
the beautiful is equally as strong as the preference it arouses
because of its exceptional performance.
The advanced practice displayed in the engineering of this model
is certain to serve as a pattern for four-cylinder development
everywhere in the industry.
And the results achieved in the way of heightened smoothness,
quietness, acceleration, and fuel economy constitute so far a step
forward as to set the car undebatably above and apart from any
comparison.
THE NASH MOTORS COMPANY
KENOSHA, WISCONSIN
Fours and Sixes—Prices Range from $915 to $2190, f. o. b. Factory
NEW HAVEN 522 FIFTH AVENUE
CONNECTICUT NEW YORK CITY
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.