1S01EC14882:2011(E目) 7 Two kinds of implementations are definod:a hooted iplementation and a freestanding inplenentation.For a bosted implementation.this International Standard defines the set of available libraries.A freestanding implketemtation is one in which executiom may take place without the bemetit of an operating system.and hss an implemestation-defined set of libraries that inchdes certain langunge-suppoet librarits (17.6.13). 8 A conforming implementation may have extensioess (including additiomal library functions).prowided they do not alter the behavior of any well-frmed program.Implementations are requirod to diagncse programs that nse sch extensions that are ill-formed according to this International Standard.Having done so,bowever, they can compile and excecute such programs. Each implementation shall include documentation that identis all conditionally-wupported constructs that it does not support and defines all locale-specific characteristics. 1.5 Structure of this International Standard intro.structure Clauses 2 through 16 describe the C++programming language.That description includes detailed syntactic speciteatioen in a form deseribed in 1.ti.For conwenienee,Annex A repeats all such syntactie speciticatioers. 2 Clauses 18 thromgh 30 and Annex D(the hibrery cleuses)describe the Standard C++library.That description icldes detaikd descriptloms o the templates,elasses.functions.coestants.and macros that constitute the library,in a form deseribed in Clause 17. 3 Anex B recommends lower bounds on the capacity of conforming implementations. 4 Amnex C summartoes the evolution of C++since its flrst publisbed deseription,and explains m detail the differenoes between C++and C.Certain featuress of C++exist solely for compatibility purpoe Annex D describes thoee features. 5 Throughout this International Standard,each excample is introduend by Erempie:"and terminated by "一end ezample].Each note is introduced by Note:”and terminated by一end note”.Examples and notes may be nested. 1.6 Syntax notation [syntax] 1 In the syntax notation used in this International Standard,syntactic categories are indicated by italic type, and literal words and eharneters in constant width type.Alternatiwes are listod om separate lines eeept in a few cases where a long set of alternatives is marked by the phrase "one of."If the text of an alternative is too long to fit o a line,the text i contimed on subeequent lines indented from the first one.An optional terminal or non-terminal symbol is indicated by the suhseript "ap",so 【pin-小 indieates an optional cpresion ecloood n braers. 2 Names for symtactie entegories have genemally boen chosen according to the follwing rules: -X-neme is a use of an identifer in a coetext that determines its meaning (e.g class-name,typedef name). -K-id is an ldeatifier with no context-dependent meaning (e.g.,qualified-id). -X.seq is one or more X's without intervening delimiters (e.g..deciaration-sey is a sequence of declara tions). -X-list is one or more X's separated by intervening commas (eg..erpression-list is a seqmuence of expressions separnted by commas). 3)This documentation abo defaes imelemertatin-defned behavice:soe 1.!. 51.6 6 。50EC2011=Ad广s reserved
7 Two kinds of implementations are defined: a hosted implementation and a freestanding implementation. For a hosted implementation, this International Standard defines the set of available libraries. A freestanding implementation is one in which execution may take place without the benefit of an operating system, and has an implementation-defined set of libraries that includes certain language-support libraries (17.6.1.3). 8 A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any well-formed program. Implementations are required to diagnose programs that use such extensions that are ill-formed according to this International Standard. Having done so, however, they can compile and execute such programs. 9 Each implementation shall include documentation that identifies all conditionally-supported constructs that it does not support and defines all locale-specific characteristics.3 1.5 Structure of this International Standard [intro.structure] 1 Clauses 2 through 16 describe the C++ programming language. That description includes detailed syntactic specifications in a form described in 1.6. For convenience, Annex A repeats all such syntactic specifications. 2 Clauses 18 through 30 and Annex D (the library clauses) describe the Standard C++ library. That description includes detailed descriptions of the templates, classes, functions, constants, and macros that constitute the library, in a form described in Clause 17. 3 Annex B recommends lower bounds on the capacity of conforming implementations. 4 Annex C summarizes the evolution of C++ since its first published description, and explains in detail the differences between C++ and C. Certain features of C++ exist solely for compatibility purposes; Annex D describes those features. 5 Throughout this International Standard, each example is introduced by “[Example:” and terminated by “ — end example ]”. Each note is introduced by “[ Note:” and terminated by “— end note ]”. Examples and notes may be nested. 1.6 Syntax notation [syntax] 1 In the syntax notation used in this International Standard, syntactic categories are indicated by italic type, and literal words and characters in constant width type. Alternatives are listed on separate lines except in a few cases where a long set of alternatives is marked by the phrase “one of.” If the text of an alternative is too long to fit on a line, the text is continued on subsequent lines indented from the first one. An optional terminal or non-terminal symbol is indicated by the subscript “opt”, so { expressionopt} indicates an optional expression enclosed in braces. 2 Names for syntactic categories have generally been chosen according to the following rules: — X-name is a use of an identifier in a context that determines its meaning (e.g., class-name, typedefname). — X-id is an identifier with no context-dependent meaning (e.g., qualified-id). — X-seq is one or more X’s without intervening delimiters (e.g., declaration-seq is a sequence of declarations). — X-list is one or more X’s separated by intervening commas (e.g., expression-list is a sequence of expressions separated by commas). 3) This documentation also defines implementation-defined behavior; see 1.9. § 1.6 ISO/IEC 14882:2011(E) 6 © ISO/IEC 2011 – All rights reserved
Is0MEC14882:2011(但目 1.7 The C++memory model [intro.memory) 1 The fumndamemtal storage unit in the C4+memory model is the byte.A byte is at kast large enomugh to coetain any member of the basic execution character set (2.3)and the eight-bit code mnits of the Unicode UTF-8 encoding form and is compoeed of a comtiguous seqoence of bits,the number of which is implementation- defined.The least significant bit is ealled the lou-order bil;the mcot signifieant bit is called the higl-order bit.The memory available to a C++program consists of ooe or more sequences of comtiguous bytes Every bte has a unlque addres. 2 [Note:The represemtation of types is decribed in 3.9.-ed note) 3 A mexory locetion is either an objeet of senlar type or a maximal sequenee of adjacent bit-felds all having non-zero width.Note:Varions features of the langunge.such ns referemes and virtual funetions,might imvolve additional memory locations that are not accessible to programs but are managed by the imple- mentation.-end note]Two threads of exceution (110)can update and access separate memory locations without interfering with each other Note:Thus a bit-field and an adjacent noe-bit-field are in separate memory locations,and therefore can be concurrently updated by two threads of executio without interference.The same applies to two bit-Belds, if ooe is declared inside a nested struct declaration and the other is not,or if the two are separated by a zero-length bit-ficld declaration,or if they are separnted by a mon-bit-field declarntion.It is not safe to concurrently update two bit-fields in the same struct if a fields betweem them are alo bit-fields of non-pero with.一end node [Erawuple:A strueture deelared as struct char a: int b:5. e:11, 0. d:8: struct [int ee:8:e: contains four separate memcey locations:The fiekd a and bit-fieldls d and a.ae are each sepnrate memnory lcations,and can be modified concurrently without interfering with each other.The bit-fields b and c together constitute the fourth memory locatiom.The bit-fields b and c cannot be comcurreatly modified,but b and a,for example,can be.-eud erample 1.8 The C++object model intro.object 1 The coestruets in a C++program ereate,destroy,refer to,access,and manipulate objeets.An offeet is a region of storape.Nate:A function is not an object,regardless of whether or not it oocupiess storage in the way that objocts do.-end mote]An object is ereated by a definition (3.1).by a pese-erpression (5.34)or by the implementation (122)when noeded.The properties of an object are determined when the objeet is ereated An objeet can have。neme [Clause3.An objeet hto a atornge durution3T)uhi由inu its lifetime (3.8).An object has a fape (3.9).The term object fype refers to the type with which the object ereated.Some objects are polymorphic (10.3):the implemetation generntes information nssoclated with each such object that makes it possible to determine that object's type during program exrention.For other objects,the interpretation of the mlues found therein is determined by the type of the erpressions (Clause 5) used to aceiso thetn. 51.8 DSOEC 2011 -Al rights teerwed 7
1.7 The C++ memory model [intro.memory] 1 The fundamental storage unit in the C++ memory model is the byte. A byte is at least large enough to contain any member of the basic execution character set (2.3) and the eight-bit code units of the Unicode UTF-8 encoding form and is composed of a contiguous sequence of bits, the number of which is implementationdefined. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit. The memory available to a C++ program consists of one or more sequences of contiguous bytes. Every byte has a unique address. 2 [ Note: The representation of types is described in 3.9. — end note ] 3 A memory location is either an object of scalar type or a maximal sequence of adjacent bit-fields all having non-zero width. [ Note: Various features of the language, such as references and virtual functions, might involve additional memory locations that are not accessible to programs but are managed by the implementation. — end note ] Two threads of execution (1.10) can update and access separate memory locations without interfering with each other. 4 [ Note: Thus a bit-field and an adjacent non-bit-field are in separate memory locations, and therefore can be concurrently updated by two threads of execution without interference. The same applies to two bit-fields, if one is declared inside a nested struct declaration and the other is not, or if the two are separated by a zero-length bit-field declaration, or if they are separated by a non-bit-field declaration. It is not safe to concurrently update two bit-fields in the same struct if all fields between them are also bit-fields of non-zero width. — end note ] 5 [Example: A structure declared as struct { char a; int b:5, c:11, :0, d:8; struct {int ee:8;} e; } contains four separate memory locations: The field a and bit-fields d and e.ee are each separate memory locations, and can be modified concurrently without interfering with each other. The bit-fields b and c together constitute the fourth memory location. The bit-fields b and c cannot be concurrently modified, but b and a, for example, can be. — end example ] 1.8 The C++ object model [intro.object] 1 The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is a region of storage. [ Note: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. — end note ] An object is created by a definition (3.1), by a new-expression (5.3.4) or by the implementation (12.2) when needed. The properties of an object are determined when the object is created. An object can have a name (Clause 3). An object has a storage duration (3.7) which influences its lifetime (3.8). An object has a type (3.9). The term object type refers to the type with which the object is created. Some objects are polymorphic (10.3); the implementation generates information associated with each such object that makes it possible to determine that object’s type during program execution. For other objects, the interpretation of the values found therein is determined by the type of the expressions (Clause 5) used to access them. § 1.8 ISO/IEC 14882:2011(E) © ISO/IEC 2011 – All rights reserved 7
130/1EC14882:2011(E) 2 Objects can contain other objects,called slobjects.A sbobject can be a memier sulobject (9.2).a base class salobjeet (Clause 10).or an arrny clement.An object that is not a subobject of am other object is called a comlete objert. 3 For every object I.there is some object called the complcte olject of x.determined as folkms 一If x i a comnplete object,tn笔s the complete object of笔 -Otberwise,the compkete object of x is the complete object of the (umique)object that contains I. 4 If a complete objeet,a data member (9.2),or an array elment is of clas type,its type is considered the most derived class,to distinguish it from the claess type of any base clase subobject:an object of a most derived closs type or of a non-class type is called a most derived odjeet. Umleees it is a bit-fieid (9.6),a moet derived object shall have a non-zero size and shall oocupy one or more bytes of stornge.Base class subobjects may have zero sixe.An object of trivially copyable or standard-layout type (3.9)shall occupy coetiguous bytes of storage. 6 Unlees an object is a bit-field or a base clase subobject of zero sice,the addresss of that object is the addrees of the first byte it occuples.Two objects that are not bet-Belds may have the same address if one is a subobjeet of the other,or if at kast one is a base class subobject of zero sixe and they are of different types;othermise, they shall hive distinct nddresees. [Erample: static const char testl "'x': sta61GCa0 st char test2■"黑'i censt bool b test1 !ktest2; ∥山ay frue 一end eramp] Note:C++provides a variety of fundamental types and several was of composing new types from existing types(得9J.一end mote 1.9 Program execution intro.execution 1 The semantic deecriptions in this International Standard define a parameterixed nondeterministic abetract machine.This Internatsomal Standard places no reqmulrement on the structure of comforming Implementatloms. In particular,they need not copy or emulate the structure of the abstract machine.Rather,conforming impleteations are reqpuired to emalate (omly)the ohservable behvior of the abstraet machine as explained below.B 2 Certain apects and operations of the abetract machine are described in this International Standard as implmenation-defined (for example,sizeof (int)).These comstitute the parameters of the abetract ma- chine.Ench implementation shall inclode documentation descrtbing its charncteristics and behavior in these respects.Such documentation shall define the instance of the abetract mchine that correspands to that implementation (referred to as the"correspooding instance"bekw). a Certain other spects and operations of the absstrnct machine are described in this International Standard ns mspecified (for example,order of evalation of argrments to a function).Where poble,this International 4)Uader the "ae-if"rule aa imglemeutation is allowed to stoee two chjects at the same machine addrews or mot store an object at all if the program eannot obeerve the diferenee (1.9). 5)This perrviddom is morrstim callod the "a-if"rule,becateo an implementation i free to diregard any rquirement of this Intersetiond Standand s long as the result is es if the requiresent had been oleyed.as far as can be detennined froms the obeerabl behavor of the program.Roe inace,an actul implemetation ned not eve paet od an exprn if it can deduce that its value is mot used and that no side efferts aBecting the chservable behavier of the program ane prodeced 争This documental进abo inchades condtcaally-wpperted comstructs and locale-apeci在ant.Soel.A. 51.9 8 ISOMEC 2011-Al ghts teserved
2 Objects can contain other objects, called subobjects. A subobject can be a member subobject (9.2), a base class subobject (Clause 10), or an array element. An object that is not a subobject of any other object is called a complete object. 3 For every object x, there is some object called the complete object of x, determined as follows: — If x is a complete object, then x is the complete object of x. — Otherwise, the complete object of x is the complete object of the (unique) object that contains x. 4 If a complete object, a data member (9.2), or an array element is of class type, its type is considered the most derived class, to distinguish it from the class type of any base class subobject; an object of a most derived class type or of a non-class type is called a most derived object. 5 Unless it is a bit-field (9.6), a most derived object shall have a non-zero size and shall occupy one or more bytes of storage. Base class subobjects may have zero size. An object of trivially copyable or standard-layout type (3.9) shall occupy contiguous bytes of storage. 6 Unless an object is a bit-field or a base class subobject of zero size, the address of that object is the address of the first byte it occupies. Two objects that are not bit-fields may have the same address if one is a subobject of the other, or if at least one is a base class subobject of zero size and they are of different types; otherwise, they shall have distinct addresses.4 [Example: static const char test1 = ’x’; static const char test2 = ’x’; const bool b = &test1 != &test2; // always true — end example ] 7 [ Note: C++ provides a variety of fundamental types and several ways of composing new types from existing types (3.9). — end note ] 1.9 Program execution [intro.execution] 1 The semantic descriptions in this International Standard define a parameterized nondeterministic abstract machine. This International Standard places no requirement on the structure of conforming implementations. In particular, they need not copy or emulate the structure of the abstract machine. Rather, conforming implementations are required to emulate (only) the observable behavior of the abstract machine as explained below.5 2 Certain aspects and operations of the abstract machine are described in this International Standard as implementation-defined (for example, sizeof(int)). These constitute the parameters of the abstract machine. Each implementation shall include documentation describing its characteristics and behavior in these respects.6 Such documentation shall define the instance of the abstract machine that corresponds to that implementation (referred to as the “corresponding instance” below). 3 Certain other aspects and operations of the abstract machine are described in this International Standard as unspecified (for example, order of evaluation of arguments to a function). Where possible, this International 4) Under the “as-if” rule an implementation is allowed to store two objects at the same machine address or not store an object at all if the program cannot observe the difference (1.9). 5) This provision is sometimes called the “as-if” rule, because an implementation is free to disregard any requirement of this International Standard as long as the result is as if the requirement had been obeyed, as far as can be determined from the observable behavior of the program. For instance, an actual implementation need not evaluate part of an expression if it can deduce that its value is not used and that no side effects affecting the observable behavior of the program are produced. 6) This documentation also includes conditonally-supported constructs and locale-specific behavior. See 1.4. § 1.9 ISO/IEC 14882:2011(E) 8 © ISO/IEC 2011 – All rights reserved
S0MEC14882:2011(日 Standard defines a set of allowable behavioes.These define the noodeterminlstic opeets of the abotract machiine.An instanoe of the abetract machine can thus have more than one poeible execution for a given proF组hda小鱼如pgt. 4 Certain other operntions are deseribed in this Intermational Standard as undefined (for eample,the effeet of attempting to modify a const object).Nede:This International Standard imposes no reqmirements on the behavior of programs that comtain undefined behavior.-end node] 8 A comforming implememtation excuting a well-formed program shall prodece the same obeernble behavior as one of the poeesible executions of the corresponding instance of the abetract mchine with the same program and the same input.Howewer,if any such exction coeains an undelined operation,this International Standard places no requirement on the implementation executing that program with that input (not even with regard to operations preceding the frst undefined operatlon). 6 When the proosing of the abestract machine is imterrupted by reoeipt of a signal,the vals of objects which are neither -of type volatile atd::aig_ateaie_t noe lock-free atomic objects (29.4) are mspecified during the meeuticn of the signal handler,and the valne of any object not in either of these two categortes that is modified by the handler becomes undefined. TAn instance of each objeet with automatie stornge duration (3.7.3)is aosociated with ench eatry into its block.Such an object exists and retains its last-stored value during the execution of the block and while the block is sumpended (by n call of a function o reeeipt of a signal) memtation are: Acoeses to volatile objects are evaluated strictly acoording to the ruless of the abetract machine. -At program termination,all data written into files shall be identical to one of the possible results that execution of the program according to the abestract semantics would have produoed. -The input and ouput dymamies of interactiv devioes shall tale place in such a fashion that prompting output is actually delivered before a program wits for input.What comstitutes an internctive device is imnplementation-defined. These collectively are referred to as the obeerble bcharior of the program.[Nofe:More stringent corre- spondepces between abstract and nctual semantics may be defined by cach implementation.-end mofe [Note:Operators can be regromped according to the usdl mathematical ruls only where the operators really are aseociative c commutative.?For exampke,in the follwwing fragment 4=t,b /作./ =4+30T04645: the expresion statement behaves excactly the same as 。▣《((m+327600+6)+5): due to the aesociativity and precedence of these operntors.Thus.the result of the sum (a 32760)is next adkled to b.and that resmult is then aded to 5 which restalts in the vlue asoigned to a.On a mnchine in which overflous produce an exoception and in which the range of values representable by an int is [-32768,+32767] the implementation cannot rewrite this expeession as )Overladed eperators are nover asumed to be assoriative o commtative. 51.9 o50EC2011=Ad广s teserved 9
Standard defines a set of allowable behaviors. These define the nondeterministic aspects of the abstract machine. An instance of the abstract machine can thus have more than one possible execution for a given program and a given input. 4 Certain other operations are described in this International Standard as undefined (for example, the effect of attempting to modify a const object). [ Note: This International Standard imposes no requirements on the behavior of programs that contain undefined behavior. — end note ] 5 A conforming implementation executing a well-formed program shall produce the same observable behavior as one of the possible executions of the corresponding instance of the abstract machine with the same program and the same input. However, if any such execution contains an undefined operation, this International Standard places no requirement on the implementation executing that program with that input (not even with regard to operations preceding the first undefined operation). 6 When the processing of the abstract machine is interrupted by receipt of a signal, the values of objects which are neither — of type volatile std::sig_atomic_t nor — lock-free atomic objects (29.4) are unspecified during the execution of the signal handler, and the value of any object not in either of these two categories that is modified by the handler becomes undefined. 7 An instance of each object with automatic storage duration (3.7.3) is associated with each entry into its block. Such an object exists and retains its last-stored value during the execution of the block and while the block is suspended (by a call of a function or receipt of a signal). 8 The least requirements on a conforming implementation are: — Access to volatile objects are evaluated strictly according to the rules of the abstract machine. — At program termination, all data written into files shall be identical to one of the possible results that execution of the program according to the abstract semantics would have produced. — The input and output dynamics of interactive devices shall take place in such a fashion that prompting output is actually delivered before a program waits for input. What constitutes an interactive device is implementation-defined. These collectively are referred to as the observable behavior of the program. [ Note: More stringent correspondences between abstract and actual semantics may be defined by each implementation. — end note ] 9 [ Note: Operators can be regrouped according to the usual mathematical rules only where the operators really are associative or commutative.7 For example, in the following fragment int a, b; /∗ ... ∗/ a = a + 32760 + b + 5; the expression statement behaves exactly the same as a = (((a + 32760) + b) + 5); due to the associativity and precedence of these operators. Thus, the result of the sum (a + 32760) is next added to b, and that result is then added to 5 which results in the value assigned to a. On a machine in which overflows produce an exception and in which the range of values representable by an int is [-32768,+32767], the implementation cannot rewrite this expression as 7) Overloaded operators are never assumed to be associative or commutative. § 1.9 ISO/IEC 14882:2011(E) © ISO/IEC 2011 – All rights reserved 9
1S0/1EC14882:2011(E) a=((a+b)+32765》: since if the valnes for a and b were,respectively,-32754 and-15,the sm a+b would produce an exoeption while the original expression would not;or can the expression be rewritten either as ■《(a◆92765)+6》: 00 。■(a+6+32765)》: since the values for a and b might have been,respectively,4 and-8 or-17 and 12.However on a machine in which overtlows do not produce an exeeption and in which the results of overtlows are reversible,the above expression statement can be remritten by the implementation in ang of the aboe ways because the same estwⅢ0c正.一dote] 10 A full-erpresion is an expression that is not a subexpresom of another exprission.If a langnage constrct is defined to produce an implicit call of a function.a use of the language construct is coeeidered to be an exprressiom for the purposes of this definition.A call to a destructor gemerated at the end of the lifetime of an objeet other than a temporary objeet is an implicit fuall-expression.Courverstons applied to the result of an exxpression in order to satisfy the requirements of the langnage cometruct in which the expreeesion appears are also considered to be part of the full-exxpresedion. Erawple: struct 8{ 8(iat4):1(1)f】 1at业y(0{xetu:nI;》 pr1at每: t1: : 81(1): /∥ull-erpression is call of8::8(it】 82”21 /∥full-empression is call可8:8(t) veid f()( 11(83).(0) //full-erpression inclades lvolve.to-realae and //int to bool cooversioms,performed before /∥femporury is defeted al end a时afl-erpreion f》 一end erample 1 Note:The evaluation of a full-cxpression can include the emluation of subexpressions that are not lexically part of the full-eopreion.Foe example,subexpreesions involved in elasting default arguments (8.3.6)are considered to be created in the expresion that calls the function.not the expreesion that defines the default aeht.一d note] 12 Accessing an object designated by a volatile ghaloe (3.10).modifying an object,calling a library 1/0 function,or enlling a function that does any of thoe operations are all side effeets,which are changes in the state of the execution enviromment.Freluation of an expression (or a sb-expressiion)in gemeral includes both value computations (including determining the identity of an object for ghuloe evaluation and fetching a walue previously assigned to am objeet foe prvalne evaluation)and initiation of side effects.When a call to a lbrary IO function returs or an aocess to a volatile object is evaluated the side effect is considered s1.9 10 DISOEC 2011 -Al rghts reervd
a = ((a + b) + 32765); since if the values for a and b were, respectively, -32754 and -15, the sum a + b would produce an exception while the original expression would not; nor can the expression be rewritten either as a = ((a + 32765) + b); or a = (a + (b + 32765)); since the values for a and b might have been, respectively, 4 and -8 or -17 and 12. However on a machine in which overflows do not produce an exception and in which the results of overflows are reversible, the above expression statement can be rewritten by the implementation in any of the above ways because the same result will occur. — end note ] 10 A full-expression is an expression that is not a subexpression of another expression. If a language construct is defined to produce an implicit call of a function, a use of the language construct is considered to be an expression for the purposes of this definition. A call to a destructor generated at the end of the lifetime of an object other than a temporary object is an implicit full-expression. Conversions applied to the result of an expression in order to satisfy the requirements of the language construct in which the expression appears are also considered to be part of the full-expression. [Example: struct S { S(int i): I(i) { } int& v() { return I; } private: int I; }; S s1(1); // full-expression is call of S::S(int) S s2 = 2; // full-expression is call of S::S(int) void f() { if (S(3).v()) // full-expression includes lvalue-to-rvalue and // int to bool conversions, performed before // temporary is deleted at end of full-expression { } } — end example ] 11 [ Note: The evaluation of a full-expression can include the evaluation of subexpressions that are not lexically part of the full-expression. For example, subexpressions involved in evaluating default arguments (8.3.6) are considered to be created in the expression that calls the function, not the expression that defines the default argument. — end note ] 12 Accessing an object designated by a volatile glvalue (3.10), modifying an object, calling a library I/O function, or calling a function that does any of those operations are all side effects, which are changes in the state of the execution environment. Evaluation of an expression (or a sub-expression) in general includes both value computations (including determining the identity of an object for glvalue evaluation and fetching a value previously assigned to an object for prvalue evaluation) and initiation of side effects. When a call to a library I/O function returns or an access to a volatile object is evaluated the side effect is considered § 1.9 ISO/IEC 14882:2011(E) 10 © ISO/IEC 2011 – All rights reserved