Стандарт C++ 98

PDF-файл Стандарт C++ 98 Практикум (Прикладное программное обеспечение и системы программирования) (37588): Другое - 4 семестрСтандарт C++ 98: Практикум (Прикладное программное обеспечение и системы программирования) - PDF (37588) - СтудИзба2019-05-09СтудИзба

Описание файла

PDF-файл из архива "Стандарт C++ 98", который расположен в категории "". Всё это находится в предмете "практикум (прикладное программное обеспечение и системы программирования)" из 4 семестр, которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .

Просмотр PDF-файла онлайн

Текст из PDF

ISO/IEC14882INTERNATIONALSTANDARDFirst edition1998-09-01Programming languages — C++Langages de programmation — C++Processed and adopted by ASC X3 and approved by ANSIas an American National Standard.Date of ANSI Approval: 7/27/98Published by American National Standards Institute,11 West 42nd Street, New York, New York 10036Copyright 1998 by Information Technology Industry Council(ITI). All rights reserved.These materials are subject to copyright claims of InternationalStandardization Organization (ISO), InternationalElectrotechnical Commission (IEC), American NationalStandards Institute (ANSI), and Information TechnologyIndustry Council (ITI).

Not for resale. No part of thispublication may be reproduced in any form, including anelectronic retrieval system, without the prior written permissionof ITI. All requests pertaining to this standard should besubmitted to ITI, 1250 Eye Street NW, Washington, DC 20005.Printed in the United States of AmericaBCReference numberISO/IEC 14882:1998(E)ISO/IEC 14882:1998(E)Contents1 General ......................................................................................................................................................

11.1 Scope ...................................................................................................................................................... 11.2 Normative references ............................................................................................................................. 11.3 Definitions.............................................................................................................................................. 11.3.1 argument..............................................................................................................................................

11.3.2 diagnostic message .............................................................................................................................. 21.3.3 dynamic type ....................................................................................................................................... 21.3.4 ill-formed program .............................................................................................................................. 21.3.5 implementation-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 unspecificed behavior........................................................................................................................ 31.3.14 well-formed program.........................................................................................................................

31.4 Implementation compliance ................................................................................................................... 31.5 Structure of this International Standard.................................................................................................. 41.6 Syntax notation....................................................................................................................................... 41.7 The C++ memory model ........................................................................................................................

41.8 The C++ object model..............................................................................................................................1.9 Program execution.................................................................................................................................. 5© ISO/IEC 1998All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by anymeans, electronic or mechanical, including photocopying and microfilm, without permission in writing from the publisher.ISO/IEC Copyright Office • Case postale 56 • CH-1211 Genève 20 • SwitzerlandPrinted in Switzerlandii© ISO/IECISO/IEC 14882:1998(E)1.10 Acknowledgments .................................................................................................................................82 Lexical conventions ....................................................................................................................................92.1 Phases of translation ................................................................................................................................92.2 Character sets .........................................................................................................................................102.3 Trigraph sequences ................................................................................................................................112.4 Preprocessing tokens .............................................................................................................................112.5 Alternative tokens ..................................................................................................................................122.6 Tokens....................................................................................................................................................122.7Comments ..............................................................................................................................................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.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 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 .......................................................................................................................33iiiISO/IEC 14882:1998(E)© ISO/IEC3.4.3.1 Class members .................................................................................................................................353.4.3.2 Namespace members .......................................................................................................................353.4.4 Elaborated type specifiers ...................................................................................................................383.4.5 Class member access ..........................................................................................................................393.4.6 Using-directives and namespace aliases .............................................................................................403.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 .....................................................................................................................................453.7.1 Static storage duration ........................................................................................................................463.7.2 Automatic storage duration.................................................................................................................463.7.3 Dynamic storage duration ...................................................................................................................463.7.3.1 Allocation functions.........................................................................................................................473.7.3.2 Deallocation functions .....................................................................................................................473.7.4 Duration of sub-objects.......................................................................................................................483.8 Object Lifetime ......................................................................................................................................483.9 Types......................................................................................................................................................513.9.1 Fundamental types ..............................................................................................................................533.9.2 Compound types .................................................................................................................................543.9.3 CV-qualifiers ......................................................................................................................................553.10 Lvalues and rvalues .............................................................................................................................554 Standard conversions ................................................................................................................................574.1 Lvalue-to-rvalue conversion ..................................................................................................................574.2 Array-to-pointer conversion ..................................................................................................................584.3 Function-to-pointer conversion .............................................................................................................584.4 Qualification conversions ......................................................................................................................584.5 Integral promotions ................................................................................................................................594.6Floating point promotion .......................................................................................................................594.7 Integral conversions ...............................................................................................................................604.8Floating point conversions .....................................................................................................................604.9 Floating-integral conversions ................................................................................................................604.10Pointer conversions ..............................................................................................................................604.11Pointer to member conversions ...........................................................................................................61iv© ISO/IECISO/IEC 14882:1998(E)4.12 Boolean conversions ............................................................................................................................615 Expressions ...............................................................................................................................................635.1 Primary expressions ...............................................................................................................................645.2 Postfix expressions ................................................................................................................................665.2.1 Subscripting ........................................................................................................................................665.2.2 Function call .......................................................................................................................................665.2.3 Explicit type conversion (functional notation) ...................................................................................685.2.4 Pseudo destructor call .........................................................................................................................685.2.5 Class member access ..........................................................................................................................685.2.6 Increment and decrement ....................................................................................................................695.2.7 Dynamic cast ......................................................................................................................................705.2.8 Type identification ..............................................................................................................................715.2.9 Static cast ............................................................................................................................................725.2.10 Reinterpret cast .................................................................................................................................735.2.11 Const cast ..........................................................................................................................................745.3 Unary expressions ..................................................................................................................................765.3.1 Unary operators...................................................................................................................................765.3.2 Increment and decrement ....................................................................................................................775.3.3 Sizeof ..................................................................................................................................................775.3.4 New .....................................................................................................................................................785.3.5 Delete ..................................................................................................................................................815.4Explicit type conversion (cast notation) ................................................................................................825.5 Pointer-to-member operators .................................................................................................................835.6Multiplicative operators .........................................................................................................................835.7Additive operators .................................................................................................................................845.8Shift operators ........................................................................................................................................855.9 Relational operators ...............................................................................................................................855.10Equality operators ................................................................................................................................865.11Bitwise AND operator ..........................................................................................................................875.12Bitwise exclusive OR operator .............................................................................................................875.13Bitwise inclusive OR operator .............................................................................................................875.14 Logical AND operator ..........................................................................................................................875.15 Logical OR operator .............................................................................................................................885.16Conditional operator ............................................................................................................................885.17Assignment operators ..........................................................................................................................89vISO/IEC 14882:1998(E)© ISO/IEC5.18Comma operator ..................................................................................................................................905.19Constant expressions ...........................................................................................................................906Statements .................................................................................................................................................936.1 Labeled statement ..................................................................................................................................936.2 Expression statement .............................................................................................................................936.3Compound statement or block ...............................................................................................................936.4 Selection statements...............................................................................................................................946.4.1 The if statement ................................................................................................................................956.4.2 The switch statement ......................................................................................................................956.5 Iteration statements ................................................................................................................................956.5.1 The while statement .........................................................................................................................966.5.2 The do statement ................................................................................................................................966.5.3 The for statement..............................................................................................................................976.6 Jump statements .....................................................................................................................................976.6.1 The break statement .........................................................................................................................976.6.2 The continue statement..................................................................................................................986.6.3 The return statement ......................................................................................................................986.6.4 The goto statement ...........................................................................................................................986.7 Declaration statement ............................................................................................................................986.8Ambiguity resolution .............................................................................................................................997 Declarations ............................................................................................................................................1017.1 Specifiers .............................................................................................................................................1027.1.1 Storage class specifiers .....................................................................................................................1037.1.2 Function specifiers ............................................................................................................................1047.1.3 The typedef specifier....................................................................................................................1057.1.4 The friend specifier ......................................................................................................................1067.1.5 Type specifiers ..................................................................................................................................1067.1.5.1 The cv-qualifiers............................................................................................................................1077.1.5.2 Simple type specifiers ....................................................................................................................1087.1.5.3 Elaborated type specifiers ..............................................................................................................1097.2 Enumeration declarations ....................................................................................................................1107.3 Namespaces .........................................................................................................................................1127.3.1 Namespace definition .......................................................................................................................1127.3.1.1 Unnamed namespaces ....................................................................................................................1137.3.1.2 Namespace member definitions .....................................................................................................1137.3.2 Namespace alias ................................................................................................................................1157.3.3 The using declaration ....................................................................................................................1157.3.4 Using directive ..................................................................................................................................1207.4 The asm declaration ............................................................................................................................123vi© ISO/IECISO/IEC 14882:1998(E)7.5 Linkage specifications .........................................................................................................................1238 Declarators ..............................................................................................................................................1278.1 Type names ..........................................................................................................................................1288.2Ambiguity resolution ...........................................................................................................................1288.3 Meaning of declarators ........................................................................................................................1308.3.1 Pointers .............................................................................................................................................1318.3.2 References .........................................................................................................................................1328.3.3 Pointers to members .........................................................................................................................1338.3.4 Arrays ...............................................................................................................................................1338.3.5 Functions...........................................................................................................................................1358.3.6 Default arguments .............................................................................................................................1378.4Function definitions .............................................................................................................................1408.5 Initializers ............................................................................................................................................1418.5.1 Aggregates ........................................................................................................................................1448.5.2 Character arrays ................................................................................................................................1468.5.3 References .........................................................................................................................................1479Classes ....................................................................................................................................................1499.1Class names .........................................................................................................................................1499.2Class members .....................................................................................................................................1519.3 Member functions ................................................................................................................................1539.3.1 Nonstatic member functions .............................................................................................................1549.3.2 The this pointer .............................................................................................................................1559.4 Static members.....................................................................................................................................1569.4.1 Static member functions ...................................................................................................................1579.4.2 Static data members ..........................................................................................................................1579.5Unions ..................................................................................................................................................1589.6Bit-fields ..............................................................................................................................................1599.7 Nested class declarations .....................................................................................................................1609.8 Local class declarations .......................................................................................................................1619.9 Nested type names ...............................................................................................................................16110 Derived classes .....................................................................................................................................16310.1Multiple base classes .........................................................................................................................16410.2 Member name lookup ........................................................................................................................16510.3 Virtual functions ................................................................................................................................168viiISO/IEC 14882:1998(E)© ISO/IEC10.4 Abstract classes ..................................................................................................................................17211 Member access control .........................................................................................................................17511.1 Access specifiers ................................................................................................................................17611.2 Accessibility of base classes and base class members .......................................................................17711.3 Access declarations ............................................................................................................................17811.4Friends ...............................................................................................................................................17911.5 Protected member access ...................................................................................................................18211.6 Access to virtual functions.................................................................................................................18311.7Multiple access ..................................................................................................................................18311.8 Nested classes ....................................................................................................................................18412 Special member functions.....................................................................................................................18512.1 Constructors .......................................................................................................................................18512.2 Temporary objects .............................................................................................................................18712.3 Conversions .......................................................................................................................................18812.3.1 Conversion by constructor ..............................................................................................................18912.3.2 Conversion functions ......................................................................................................................19012.4 Destructors .........................................................................................................................................19112.5 Free store ...........................................................................................................................................19412.6 Initialization .......................................................................................................................................19512.6.1 Explicit initialization ......................................................................................................................19612.6.2 Initializing bases and members .......................................................................................................19712.7Construction and destruction .............................................................................................................20012.8Copying class objects ........................................................................................................................20313 Overloading ..........................................................................................................................................20913.1 Overloadable declarations..................................................................................................................20913.2 Declaration matching .........................................................................................................................21113.3 Overload resolution ...........................................................................................................................21213.3.1 Candidate functions and argument lists ..........................................................................................21313.3.1.1 Function call syntax .....................................................................................................................21413.3.1.1.1 Call to named function..............................................................................................................21413.3.1.1.2 Call to object of class type ........................................................................................................21513.3.1.2 Operators in expressions ..............................................................................................................216viii© ISO/IECISO/IEC 14882:1998(E)13.3.1.3 Initialization by constructor .........................................................................................................21813.3.1.4 Copy-initialization of class by user-defined conversion..............................................................21813.3.1.5 Initialization by conversion function ...........................................................................................21813.3.1.6 Initialization by conversion function for direct reference binding ..............................................21913.3.2 Viable functions ..............................................................................................................................21913.3.3 Best Viable Function ......................................................................................................................21913.3.3.1 Implicit conversion sequences .....................................................................................................22113.3.3.1.1 Standard conversion sequences ................................................................................................22213.3.3.1.2 User-defined conversion sequences ..........................................................................................22313.3.3.1.3 Ellipsis conversion sequences...................................................................................................22313.3.3.1.4 Reference binding .....................................................................................................................22413.3.3.2 Ranking implicit conversion sequences.......................................................................................22413.4 Address of overloaded function .........................................................................................................22613.5 Overloaded operators .........................................................................................................................22713.5.1 Unary operators...............................................................................................................................22813.5.2 Binary operators..............................................................................................................................22913.5.3 Assignment .....................................................................................................................................22913.5.4 Function call ...................................................................................................................................22913.5.5 Subscripting ....................................................................................................................................23013.5.6 Class member access ......................................................................................................................23013.5.7 Increment and decrement ................................................................................................................23013.6Built-in operators ...............................................................................................................................23114 Templates ..............................................................................................................................................23514.1 Template parameters ..........................................................................................................................23614.2 Names of template specializations .....................................................................................................23814.3 Template arguments...........................................................................................................................23914.3.1 Template type arguments ................................................................................................................24114.3.2 Template non-type arguments ........................................................................................................24214.3.3 Template template arguments .........................................................................................................24314.4 Type equivalence ...............................................................................................................................24414.5 Template declarations ........................................................................................................................24414.5.1 Class templates ...............................................................................................................................24414.5.1.1 Member functions of class templates...........................................................................................24514.5.1.2 Member classes of class templates ..............................................................................................24614.5.1.3 Static data members of class templates........................................................................................24614.5.2 Member templates ..........................................................................................................................24614.5.3 Friends ............................................................................................................................................24814.5.4 Class template partial specializations .............................................................................................25014.5.4.1 Matching of class template partial specializations ......................................................................25214.5.4.2 Partial ordering of class template specializations ........................................................................25214.5.4.3 Members of class template specializations ..................................................................................25314.5.5 Function templates ..........................................................................................................................25414.5.5.1 Function template overloading ....................................................................................................25414.5.5.2 Partial ordering of function templates .........................................................................................256ixISO/IEC 14882:1998(E)© ISO/IEC14.6 Name resolution .................................................................................................................................25714.6.1 Locally declared names ..................................................................................................................26014.6.2 Dependent names ............................................................................................................................26214.6.2.1 Dependent types...........................................................................................................................26314.6.2.2 Type-dependent expressions ........................................................................................................26314.6.2.3 Value-dependent expressions ......................................................................................................26414.6.2.4 Dependent template arguments ....................................................................................................26414.6.3 Non-dependent names.....................................................................................................................26514.6.4 Dependent name resolution ............................................................................................................26514.6.4.1 Point of instantiation ....................................................................................................................26514.6.4.2 Candidate functions .....................................................................................................................26614.6.5 Friend names declared within a class template ...............................................................................26614.7 Template instantiation and specialization ..........................................................................................26714.7.1 Implicit instantiation .......................................................................................................................26814.7.2 Explicit instantiation .......................................................................................................................27114.7.3 Explicit specialization .....................................................................................................................27214.8 Function template specializations ......................................................................................................27714.8.1 Explicit template argument specification .......................................................................................27814.8.2 Template argument deduction ........................................................................................................28014.8.2.1 Deducing template arguments from a function call .....................................................................28214.8.2.2 Deducing template arguments taking the address of a function template ...................................28314.8.2.3 Deducing conversion function template arguments.....................................................................28314.8.2.4 Deducing template arguments from a type ..................................................................................28314.8.3 Overload resolution ........................................................................................................................28815 Exception handling ...............................................................................................................................29115.1 Throwing an exception ......................................................................................................................29215.2 Constructors and destructors..............................................................................................................29415.3 Handling an exception .......................................................................................................................29415.4 Exception specifications ....................................................................................................................29615.5 Special functions ................................................................................................................................29815.5.1 The terminate() function ........................................................................................................29815.5.2 The unexpected() function ......................................................................................................29915.5.3 The uncaught_exception() function ...................................................................................29915.6 Exceptions and access ........................................................................................................................29916 Preprocessing directives .......................................................................................................................30116.1Conditional inclusion .........................................................................................................................30216.2 Source file inclusion ..........................................................................................................................30316.3 Macro replacement ............................................................................................................................30416.3.1 Argument substitution ....................................................................................................................30516.3.2 The # operator ................................................................................................................................30516.3.3 The ## operator ..............................................................................................................................306x© ISO/IECISO/IEC 14882:1998(E)16.3.4 Rescanning and further replacement...............................................................................................30616.3.5 Scope of macro definitions .............................................................................................................30616.4 Line control ........................................................................................................................................30816.5 Error directive ....................................................................................................................................30816.6 Pragma directive ................................................................................................................................30816.7Null directive .....................................................................................................................................30816.8 Predefined macro names ....................................................................................................................30917 Library introduction ..............................................................................................................................31117.1 Definitions .........................................................................................................................................31117.1.1 arbitrary-positional stream ..............................................................................................................31117.1.2 character ..........................................................................................................................................31117.1.3 character container type ..................................................................................................................31117.1.4 comparison function .......................................................................................................................31117.1.5 component.......................................................................................................................................31217.1.6 default behavior ..............................................................................................................................31217.1.7 handler function ..............................................................................................................................31217.1.8 iostream class templates .................................................................................................................31217.1.9 modifier function ............................................................................................................................31217.1.10 object state ....................................................................................................................................31217.1.11 narrow-oriented iostream classes ..................................................................................................31217.1.12 NTCTS ..........................................................................................................................................31217.1.13 observer function ..........................................................................................................................31217.1.14 replacement function.....................................................................................................................31217.1.15 required behavior ..........................................................................................................................31217.1.16 repositional stream ........................................................................................................................31317.1.17 reserved function...........................................................................................................................31317.1.18 traits class......................................................................................................................................31317.1.19 wide-oriented iostream classes .....................................................................................................31317.2Additional definitions ........................................................................................................................31317.3 Method of description (Informative) .................................................................................................31317.3.1 Structure of each subclause.............................................................................................................31317.3.1.1 Summary ......................................................................................................................................31417.3.1.2 Requirements ...............................................................................................................................31417.3.1.3 Specifications ...............................................................................................................................31417.3.1.4 C Library ......................................................................................................................................31517.3.2 Other conventions ...........................................................................................................................31517.3.2.1 Type descriptions .........................................................................................................................31517.3.2.1.1 Enumerated types......................................................................................................................31617.3.2.1.2 Bitmask types............................................................................................................................31617.3.2.1.3 Character sequences ..................................................................................................................31717.3.2.1.3.1 Byte strings ............................................................................................................................31717.3.2.1.3.2 Multibyte strings ....................................................................................................................31817.3.2.1.3.3 Wide-character sequences ......................................................................................................31817.3.2.2 Functions within classes ..............................................................................................................31817.3.2.3 Private members ..........................................................................................................................318xiISO/IEC 14882:1998(E)© ISO/IEC17.4 Library-wide requirements ................................................................................................................31817.4.1 Library contents and organization ..................................................................................................31917.4.1.1 Library contents ...........................................................................................................................31917.4.1.2 Headers ........................................................................................................................................31917.4.1.3 Freestanding implementations .....................................................................................................32017.4.2 Using the library .............................................................................................................................32017.4.2.1 Headers ........................................................................................................................................32017.4.2.2 Linkage ........................................................................................................................................32117.4.3 Constraints on programs .................................................................................................................32117.4.3.1 Reserved names ...........................................................................................................................32117.4.3.1.1 Macro names .............................................................................................................................32117.4.3.1.2 Global names ............................................................................................................................32117.4.3.1.3 External linkage ........................................................................................................................32217.4.3.1.4 Types.........................................................................................................................................32217.4.3.2 Headers ........................................................................................................................................32217.4.3.3 Derived classes ............................................................................................................................32217.4.3.4 Replacement functions.................................................................................................................32217.4.3.5 Handler functions.........................................................................................................................32317.4.3.6 Other functions ............................................................................................................................32317.4.3.7 Function arguments .....................................................................................................................32417.4.3.8 Required paragraph ......................................................................................................................32417.4.4 Conforming implementations .........................................................................................................32417.4.4.1 Headers ........................................................................................................................................32417.4.4.2 Restrictions on macro definitions ................................................................................................32417.4.4.3 Global functions...........................................................................................................................32417.4.4.4 Member functions ........................................................................................................................32517.4.4.5 Reentrancy ...................................................................................................................................32517.4.4.6 Protection within classes..............................................................................................................32517.4.4.7 Derived classes ............................................................................................................................32517.4.4.8 Restrictions on exception handling ..............................................................................................32518 Language support library ......................................................................................................................32718.1 Types..................................................................................................................................................32718.2 Implementation properties .................................................................................................................32818.2.1 Numeric limits ................................................................................................................................32818.2.1.1 Template class numeric_limits...........................................................................................32818.2.1.2 numeric_limits members ....................................................................................................32918.2.1.3 Type float_round_style ...................................................................................................33318.2.1.4 Type float_denorm_style.................................................................................................33418.2.1.5 numeric_limits specializations ...........................................................................................33418.2.2 C Library .........................................................................................................................................33518.3Start and termination..........................................................................................................................33618.4 Dynamic memory management .........................................................................................................33718.4.1 Storage allocation and deallocation ................................................................................................33718.4.1.1 Single-object forms ......................................................................................................................33718.4.1.2 Array forms ..................................................................................................................................33818.4.1.3 Placement forms ..........................................................................................................................33918.4.2 Storage allocation errors .................................................................................................................34018.4.2.1 Class bad_alloc ......................................................................................................................34018.4.2.2 Type new_handler..................................................................................................................340xii© ISO/IEC18.4.2.3ISO/IEC 14882:1998(E)set_new_handler .................................................................................................................34118.5 Type identification .............................................................................................................................34118.5.1 Class type_info .........................................................................................................................34118.5.2 Class bad_cast ...........................................................................................................................34218.5.3 Class bad_typeid.......................................................................................................................34218.6 Exception handling ............................................................................................................................34318.6.1 Class exception .........................................................................................................................34318.6.2 Violating exception-specifications...............................................................................34418.6.2.1 Class bad_exception ............................................................................................................34418.6.2.2 Type unexpected_handler.................................................................................................34518.6.2.3 set_unexpected....................................................................................................................34518.6.2.4 unexpected .............................................................................................................................34518.6.3 Abnormal termination .....................................................................................................................34518.6.3.1 Type terminate_handler ...................................................................................................34518.6.3.2 set_terminate ......................................................................................................................34518.6.3.3 terminate................................................................................................................................34518.6.4 uncaught_exception .............................................................................................................34618.7 Other runtime support ........................................................................................................................34619 Diagnostics library ................................................................................................................................34919.1 Exception classes ...............................................................................................................................34919.1.1 Class logic_error ....................................................................................................................34919.1.2 Class domain_error..................................................................................................................35019.1.3 Class invalid_argument ........................................................................................................35019.1.4 Class length_error..................................................................................................................35019.1.5 Class out_of_range..................................................................................................................35119.1.6 Class runtime_error ...............................................................................................................35119.1.7 Class range_error ....................................................................................................................35119.1.8 Class overflow_error .............................................................................................................35119.1.9 Class underflow_error...........................................................................................................35219.2 Assertions ..........................................................................................................................................35219.3 Error numbers ....................................................................................................................................35220 General utilities library .........................................................................................................................35320.1 Requirements .....................................................................................................................................35320.1.1 Equality comparison .......................................................................................................................35320.1.2 Less than comparison .....................................................................................................................35320.1.3 Copy construction ...........................................................................................................................35420.1.4 Default construction........................................................................................................................35420.1.5 Allocator requirements ...................................................................................................................35420.2 Utility components.............................................................................................................................35720.2.1 Operators.........................................................................................................................................35720.2.2 Pairs ................................................................................................................................................35820.3 Function objects .................................................................................................................................35920.3.1 Base.................................................................................................................................................361xiiiISO/IEC 14882:1998(E)© ISO/IEC20.3.2 Arithmetic operations .....................................................................................................................36120.3.3 Comparisons ...................................................................................................................................36220.3.4 Logical operations ..........................................................................................................................36320.3.5 Negators ..........................................................................................................................................36320.3.6 Binders ............................................................................................................................................36420.3.6.1 Template class binder1st.......................................................................................................36420.3.6.2 bind1st.....................................................................................................................................36420.3.6.3 Template class binder2nd.......................................................................................................36420.3.6.4 bind2nd.....................................................................................................................................36520.3.7 Adaptors for pointers to functions ..................................................................................................36520.3.8 Adaptors for pointers to members ..................................................................................................36620.4 Memory..............................................................................................................................................36820.4.1 The default allocator .......................................................................................................................36820.4.1.1 allocator members ................................................................................................................36920.4.1.2 allocator globals ...................................................................................................................37020.4.2 Raw storage iterator ........................................................................................................................37020.4.3 Temporary buffers ..........................................................................................................................37120.4.4 Specialized algorithms ....................................................................................................................37120.4.4.1 uninitialized_copy ..........................................................................................................37120.4.4.2 uninitialized_fill ..........................................................................................................37220.4.4.3 uninitialized_fill_n .....................................................................................................37220.4.5 Template class auto_ptr ............................................................................................................37220.4.5.1 auto_ptr constructors..............................................................................................................37320.4.5.2 auto_ptr members ..................................................................................................................37320.4.5.3 auto_ptr conversions ..............................................................................................................37420.4.6 C Library .........................................................................................................................................37420.5 Date and time .....................................................................................................................................37521Strings library .......................................................................................................................................37721.1 Character traits ...................................................................................................................................37721.1.1 Character traits requirements ..........................................................................................................37721.1.2 traits typedefs ..................................................................................................................................37921.1.3 char_traits specializations .....................................................................................................37921.1.3.1 struct char_traits<char>............................................................................................37921.1.3.2 struct char_traits<wchar_t>.....................................................................................38021.2String classes .....................................................................................................................................38121.3 Template class basic_string......................................................................................................38321.3.1 basic_string constructors .......................................................................................................38721.3.2 basic_string iterator support ..................................................................................................39021.3.3 basic_string capacity .............................................................................................................39021.3.4 basic_string element access ...................................................................................................39121.3.5 basic_string modifiers ...........................................................................................................39221.3.5.1 basic_string::operator+=............................................................................................39221.3.5.2 basic_string::append .....................................................................................................39221.3.5.3 basic_string::assign .....................................................................................................39321.3.5.4 basic_string::insert .....................................................................................................39321.3.5.5 basic_string::erase........................................................................................................39421.3.5.6 basic_string::replace...................................................................................................39521.3.5.7 basic_string::copy ..........................................................................................................396xiv© ISO/IECISO/IEC 14882:1998(E)21.3.5.8 basic_string::swap ..........................................................................................................39721.3.6 basic_string string operations ................................................................................................39721.3.6.1 basic_string::find ..........................................................................................................39721.3.6.2 basic_string::rfind........................................................................................................39821.3.6.3 basic_string::find_first_of.....................................................................................39821.3.6.4 basic_string::find_last_of.......................................................................................39921.3.6.5 basic_string::find_first_not_of...........................................................................39921.3.6.6 basic_string::find_last_not_of .............................................................................40021.3.6.7 basic_string::substr .....................................................................................................40021.3.6.8 basic_string::compare...................................................................................................40021.3.7 basic_string non-member functions ......................................................................................40121.3.7.1 operator+................................................................................................................................40121.3.7.2 operator== .............................................................................................................................40221.3.7.3 operator!= .............................................................................................................................40221.3.7.4 operator<................................................................................................................................40321.3.7.5 operator>................................................................................................................................40321.3.7.6 operator<= .............................................................................................................................40321.3.7.7 operator>= .............................................................................................................................40421.3.7.8 swap............................................................................................................................................40421.3.7.9 Inserters and extractors ................................................................................................................40421.4 Null-terminated sequence utilities .....................................................................................................40522 Localization library ...............................................................................................................................40922.1 Locales ...............................................................................................................................................40922.1.1 Class locale ................................................................................................................................41022.1.1.1 locale types .............................................................................................................................41222.1.1.1.1 Type locale::category...................................................................................................41222.1.1.1.2 Class locale::facet .........................................................................................................41422.1.1.1.3 Class locale::id.................................................................................................................41422.1.1.2 locale constructors and destructor ...........................................................................................41522.1.1.3 locale members .......................................................................................................................41622.1.1.4 locale operators .......................................................................................................................41622.1.1.5 locale static members ..............................................................................................................41622.1.2 locale globals .............................................................................................................................41722.1.3 Convenience interfaces ...................................................................................................................41722.1.3.1 Character classification ................................................................................................................41722.1.3.2 Character conversions ..................................................................................................................41722.2 Standard locale categories.............................................................................................................41822.2.1 The ctype category ......................................................................................................................41822.2.1.1 Template class ctype ................................................................................................................41822.2.1.1.1 ctype members .......................................................................................................................41922.2.1.1.2 ctype virtual functions ...........................................................................................................42022.2.1.2 Template class ctype_byname................................................................................................42122.2.1.3 ctype specializations .................................................................................................................42222.2.1.3.1 ctype<char> destructor .......................................................................................................42322.2.1.3.2 ctype<char> members ........................................................................................................42322.2.1.3.3 ctype<char> static members ...............................................................................................42422.2.1.3.4 ctype<char> virtual functions.............................................................................................42422.2.1.4 Class ctype_byname<char> .........................................................................................................42522.2.1.5 Template class codecvt............................................................................................................42522.2.1.5.1 codecvt members ..................................................................................................................426xvISO/IEC 14882:1998(E)© ISO/IEC22.2.1.5.2 codecvt virtual functions ......................................................................................................42722.2.1.6 Template class codecvt_byname...........................................................................................42922.2.2 The numeric category .....................................................................................................................42922.2.2.1 Template class num_get............................................................................................................42922.2.2.1.1 num_get members ..................................................................................................................43122.2.2.1.2 num_get virtual functions ......................................................................................................43122.2.2.2 Template class num_put............................................................................................................43322.2.2.2.1 num_put members ..................................................................................................................43422.2.2.2.2 num_put virtual functions ......................................................................................................43422.2.3 The numeric punctuation facet .......................................................................................................43722.2.3.1 Template class numpunct .........................................................................................................43722.2.3.1.1 numpunct members ...............................................................................................................43822.2.3.1.2 numpunct virtual functions ....................................................................................................43922.2.3.2 Template class numpunct_byname ........................................................................................43922.2.4 The collate category ........................................................................................................................43922.2.4.1 Template class collate............................................................................................................43922.2.4.1.1 collate members ..................................................................................................................44022.2.4.1.2 collate virtual functions ......................................................................................................44022.2.4.2 Template class collate_byname...........................................................................................44122.2.5 The time category ...........................................................................................................................44122.2.5.1 Template class time_get .........................................................................................................44122.2.5.1.1 time_get members ...............................................................................................................44222.2.5.1.2 time_get virtual functions ....................................................................................................44322.2.5.2 Template class time_get_byname ........................................................................................44422.2.5.3 Template class time_put .........................................................................................................44422.2.5.3.1 time_put members ...............................................................................................................44522.2.5.3.2 time_put virtual functions ....................................................................................................44522.2.5.4 Template class time_put_byname ........................................................................................44522.2.6 The monetary category ...................................................................................................................44622.2.6.1 Template class money_get.......................................................................................................44622.2.6.1.1 money_get members .............................................................................................................44622.2.6.1.2 money_get virtual functions .................................................................................................44622.2.6.2 Template class money_put.......................................................................................................44822.2.6.2.1 money_put members .............................................................................................................44822.2.6.2.2 money_put virtual functions .................................................................................................44822.2.6.3 Template class moneypunct ....................................................................................................44922.2.6.3.1 moneypunct members ...........................................................................................................45022.2.6.3.2 moneypunct virtual functions ...............................................................................................45022.2.6.4 Template class moneypunct_byname....................................................................................45122.2.7 The message retrieval category.......................................................................................................45222.2.7.1 Template class messages .........................................................................................................45222.2.7.1.1 messages members ...............................................................................................................45222.2.7.1.2 messages virtual functions ....................................................................................................45322.2.7.2 Template class messages_byname ........................................................................................45322.2.8 Program-defined facets ...................................................................................................................45322.3C Library Locales ..............................................................................................................................45723 Containers library .................................................................................................................................45923.1 Container requirements ......................................................................................................................45923.1.1 Sequences .......................................................................................................................................46223.1.2 Associative containers ....................................................................................................................464xvi© ISO/IECISO/IEC 14882:1998(E)23.2 Sequences ..........................................................................................................................................46723.2.1 Template class deque ...................................................................................................................47023.2.1.1 deque constructors, copy, and assignment ................................................................................47223.2.1.2 deque capacity ...........................................................................................................................47323.2.1.3 deque modifiers .........................................................................................................................47323.2.1.4 deque specialized algorithms ....................................................................................................47323.2.2 Template class list......................................................................................................................47423.2.2.1 list constructors, copy, and assignment ...................................................................................47623.2.2.2 list capacity .............................................................................................................................47723.2.2.3 list modifiers ...........................................................................................................................47723.2.2.4 list operations ..........................................................................................................................47723.2.2.5 list specialized algorithms .......................................................................................................47923.2.3 Container adaptors ..........................................................................................................................47923.2.3.1 Template class queue ................................................................................................................47923.2.3.2 Template class priority_queue...........................................................................................48023.2.3.2.1 priority_queue constructors ............................................................................................48123.2.3.2.2 priority_queue members .................................................................................................48123.2.3.3 Template class stack ................................................................................................................48123.2.4 Template class vector .................................................................................................................48223.2.4.1 vector constructors, copy, and assignment ..............................................................................48423.2.4.2 vector capacity.........................................................................................................................48523.2.4.3 vector modifiers.......................................................................................................................48523.2.4.4 vector specialized algorithms ..................................................................................................48623.2.5 Class vector<bool>..................................................................................................................48623.3 Associative containers .......................................................................................................................48823.3.1 Template class map ........................................................................................................................49023.3.1.1 map constructors, copy, and assignment .....................................................................................49223.3.1.2 map element access .....................................................................................................................49323.3.1.3 map operations ............................................................................................................................49323.3.1.4 map specialized algorithms .........................................................................................................49323.3.2 Template class multimap ............................................................................................................49323.3.2.1 multimap constructors..............................................................................................................49623.3.2.2 multimap operations ................................................................................................................49623.3.2.3 multimap specialized algorithms .............................................................................................49623.3.3 Template class set ........................................................................................................................49623.3.3.1 set constructors, copy, and assignment .....................................................................................49823.3.3.2 set specialized algorithms .........................................................................................................49923.3.4 Template class multiset ............................................................................................................49923.3.4.1 multiset constructors..............................................................................................................50123.3.4.2 multiset specialized algorithms .............................................................................................50123.3.5 Template class bitset .................................................................................................................50223.3.5.1 bitset constructors ..................................................................................................................50323.3.5.2 bitset members .......................................................................................................................50423.3.5.3 bitset operators .......................................................................................................................50624 Iterators library .....................................................................................................................................50924.1 Iterator requirements ..........................................................................................................................50924.1.1 Input iterators ..................................................................................................................................51024.1.2 Output iterators ...............................................................................................................................51124.1.3 Forward iterators .............................................................................................................................51224.1.4 Bidirectional iterators .....................................................................................................................51324.1.5 Random access iterators..................................................................................................................513xviiISO/IEC 14882:1998(E)© ISO/IEC24.2 Header <iterator> synopsis ........................................................................................................51424.3 Iterator primitives ..............................................................................................................................51624.3.1 Iterator traits....................................................................................................................................51624.3.2 Basic iterator ...................................................................................................................................51724.3.3 Standard iterator tags ......................................................................................................................51824.3.4 Iterator operations ...........................................................................................................................51924.4 Predefined iterators ............................................................................................................................51924.4.1 Reverse iterators .............................................................................................................................51924.4.1.1 Template class reverse_iterator ......................................................................................52024.4.1.2 reverse_iterator requirements .........................................................................................52124.4.1.3 reverse_iterator operations .............................................................................................52124.4.1.3.1 reverse_iterator constructor .........................................................................................52124.4.1.3.2 Conversion ................................................................................................................................52124.4.1.3.3 operator*.............................................................................................................................52124.4.1.3.4 operator-> ..........................................................................................................................52224.4.1.3.5 operator++ ..........................................................................................................................52224.4.1.3.6 operator-- ..........................................................................................................................52224.4.1.3.7 operator+.............................................................................................................................52224.4.1.3.8 operator+= ..........................................................................................................................52224.4.1.3.9 operator-.............................................................................................................................52324.4.1.3.10 operator-= ........................................................................................................................52324.4.1.3.11 operator[] ........................................................................................................................52324.4.1.3.12 operator== ........................................................................................................................52324.4.1.3.13 operator<...........................................................................................................................52324.4.1.3.14 operator!= ........................................................................................................................52324.4.1.3.15 operator>...........................................................................................................................52324.4.1.3.16 operator>= ........................................................................................................................52424.4.1.3.17 operator<= ........................................................................................................................52424.4.1.3.18 operator-...........................................................................................................................52424.4.1.3.19 operator+...........................................................................................................................52424.4.2 Insert iterators .................................................................................................................................52424.4.2.1 Template class back_insert_iterator ............................................................................52524.4.2.2 back_insert_iterator operations ....................................................................................52524.4.2.2.1 back_insert_iterator constructor ...............................................................................52524.4.2.2.2 back_insert_iterator::operator=........................................................................52524.4.2.2.3 back_insert_iterator::operator*........................................................................52524.4.2.2.4 back_insert_iterator::operator++......................................................................52524.4.2.2.5 back_inserter ...................................................................................................................52624.4.2.3 Template class front_insert_iterator ..........................................................................52624.4.2.4 front_insert_iterator operations .................................................................................52624.4.2.4.1 front_insert_iterator constructor .............................................................................52624.4.2.4.2 front_insert_iterator::operator=......................................................................52624.4.2.4.3 front_insert_iterator::operator*......................................................................52624.4.2.4.4 front_insert_iterator::operator++ ...................................................................52724.4.2.4.5 front_inserter.................................................................................................................52724.4.2.5 Template class insert_iterator ........................................................................................52724.4.2.6 insert_iterator operations ................................................................................................52724.4.2.6.1 insert_iterator constructor ...........................................................................................52724.4.2.6.2 insert_iterator::operator=....................................................................................52724.4.2.6.3 insert_iterator::operator*....................................................................................52824.4.2.6.4 insert_iterator::operator++..................................................................................52824.4.2.6.5 inserter ...............................................................................................................................528xviii© ISO/IECISO/IEC 14882:1998(E)24.5 Stream iterators ..................................................................................................................................52824.5.1 Template class istream_iterator .........................................................................................52824.5.1.1 istream_iterator constructors and destructor ...................................................................52924.5.1.2 istream_iterator operations .............................................................................................52924.5.2 Template class ostream_iterator .........................................................................................53024.5.2.1 ostream_iterator constructors and destructor ...................................................................53124.5.2.2 ostream_iterator operations .............................................................................................53124.5.3 Template class istreambuf_iterator..................................................................................53124.5.3.1 Template class istreambuf_iterator::proxy ..............................................................53224.5.3.2 istreambuf_iterator constructors ...................................................................................53324.5.3.3 istreambuf_iterator::operator* .............................................................................53324.5.3.4 istreambuf_iterator::operator++...........................................................................53324.5.3.5 istreambuf_iterator::equal.......................................................................................53324.5.3.6 operator== .............................................................................................................................53324.5.3.7 operator!= .............................................................................................................................53424.5.4 Template class ostreambuf_iterator..................................................................................53424.5.4.1 ostreambuf_iterator constructors ...................................................................................53424.5.4.2 ostreambuf_iterator operations ......................................................................................53425Algorithms library ................................................................................................................................53725.1 Non-modifying sequence operations .................................................................................................54525.1.1 For each ..........................................................................................................................................54525.1.2 Find .................................................................................................................................................54625.1.3 Find End..........................................................................................................................................54625.1.4 Find First.........................................................................................................................................54625.1.5 Adjacent find ..................................................................................................................................54725.1.6 Count...............................................................................................................................................54725.1.7 Mismatch ........................................................................................................................................54725.1.8 Equal ...............................................................................................................................................54825.1.9 Search .............................................................................................................................................54825.2 Mutating sequence operations ...........................................................................................................54925.2.1 Copy ................................................................................................................................................54925.2.2 Swap ...............................................................................................................................................54925.2.3 Transform .......................................................................................................................................55025.2.4 Replace ...........................................................................................................................................55025.2.5 Fill ...................................................................................................................................................55125.2.6 Generate ..........................................................................................................................................55125.2.7 Remove ...........................................................................................................................................55125.2.8 Unique.............................................................................................................................................55225.2.9 Reverse ...........................................................................................................................................55225.2.10 Rotate ............................................................................................................................................55325.2.11 Random shuffle .............................................................................................................................55325.2.12 Partitions .......................................................................................................................................55425.3 Sorting and related operations ...........................................................................................................55425.3.1 Sorting.............................................................................................................................................55525.3.1.1 sort............................................................................................................................................55525.3.1.2 stable_sort...........................................................................................................................55525.3.1.3 partial_sort.........................................................................................................................55525.3.1.4 partial_sort_copy.............................................................................................................55625.3.2 Nth element .....................................................................................................................................55625.3.3 Binary search ..................................................................................................................................556xixISO/IEC 14882:1998(E)© ISO/IEC25.3.3.1 lower_bound...........................................................................................................................55625.3.3.2 upper_bound...........................................................................................................................55725.3.3.3 equal_range...........................................................................................................................55725.3.3.4 binary_search ......................................................................................................................55725.3.4 Merge ..............................................................................................................................................55825.3.5 Set operations on sorted structures .................................................................................................55825.3.5.1 includes ..................................................................................................................................55925.3.5.2 set_union................................................................................................................................55925.3.5.3 set_intersection...............................................................................................................55925.3.5.4 set_difference....................................................................................................................56025.3.5.5 set_symmetric_difference............................................................................................56025.3.6 Heap operations ..............................................................................................................................56025.3.6.1 push_heap................................................................................................................................56125.3.6.2 pop_heap ..................................................................................................................................56125.3.6.3 make_heap................................................................................................................................56125.3.6.4 sort_heap................................................................................................................................56125.3.7 Minimum and maximum ................................................................................................................56225.3.8 Lexicographical comparison ...........................................................................................................56225.3.9 Permutation generators ...................................................................................................................56325.4C library algorithms ...........................................................................................................................56326 Numerics library ...................................................................................................................................56526.1 Numeric type requirements ................................................................................................................56526.2 Complex numbers ..............................................................................................................................56626.2.1 Header <complex> synopsis .......................................................................................................56626.2.2 Template class complex...............................................................................................................56726.2.3 complex specializations ...............................................................................................................56926.2.4 complex member functions..........................................................................................................57026.2.5 complex member operators..........................................................................................................57026.2.6 complex non-member operations ................................................................................................57126.2.7 complex value operations ............................................................................................................57226.2.8 complex transcendentals ..............................................................................................................57326.3 Numeric arrays ...................................................................................................................................57426.3.1 Header <valarray> synopsis .....................................................................................................57426.3.2 Template class valarray ............................................................................................................57726.3.2.1 valarray constructors..............................................................................................................57826.3.2.2 valarray assignment ...............................................................................................................57926.3.2.3 valarray element access .........................................................................................................58026.3.2.4 valarray subset operations .....................................................................................................58026.3.2.5 valarray unary operators ........................................................................................................58026.3.2.6 valarray computed assignment ..............................................................................................58126.3.2.7 valarray member functions ....................................................................................................58126.3.3 valarray non-member operations ..............................................................................................58326.3.3.1 valarray binary operators .......................................................................................................58326.3.3.2 valarray logical operators ......................................................................................................58426.3.3.3 valarray transcendentals.........................................................................................................58526.3.4 Class slice...................................................................................................................................58526.3.4.1 slice constructors .....................................................................................................................58526.3.4.2 slice access functions ..............................................................................................................58626.3.5 Template class slice_array .....................................................................................................586xx© ISO/IECISO/IEC 14882:1998(E)26.3.5.1 slice_array constructors ......................................................................................................58726.3.5.2 slice_array assignment ........................................................................................................58726.3.5.3 slice_array computed assignment .......................................................................................58726.3.5.4 slice_array fill function .......................................................................................................58726.3.6 The gslice class ..........................................................................................................................58726.3.6.1 gslice constructors........................................................................................................58826.3.6.2 gslice access functions ............................................................................................................58926.3.7 Template class gslice_array...................................................................................................58926.3.7.1 gslice_array constructors ....................................................................................................58926.3.7.2 gslice_array assignment......................................................................................................59026.3.7.3 gslice_array computed assignment.........................................................................59026.3.7.4 gslice_array fill function.....................................................................................................59026.3.8 Template class mask_array .......................................................................................................59026.3.8.1 mask_array constructors .........................................................................................................59126.3.8.2 mask_array assignment ..........................................................................................................59126.3.8.3 mask_array computed assignment..........................................................................................59126.3.8.4 mask_array fill function .........................................................................................................59226.3.9 Template class indirect_array..............................................................................................59226.3.9.1 indirect_array constructors ...............................................................................................59226.3.9.2 indirect_array assignment .................................................................................................59326.3.9.3 indirect_array computed assignment ................................................................................59326.3.9.4 indirect_array fill function ................................................................................................59326.4 Generalized numeric operations ........................................................................................................59326.4.1 Accumulate .....................................................................................................................................59426.4.2 Inner product ...................................................................................................................................59526.4.3 Partial sum ......................................................................................................................................59526.4.4 Adjacent difference .........................................................................................................................59526.527C Library ............................................................................................................................................596Input/output library ...............................................................................................................................59927.1 Iostreams requirements ......................................................................................................................59927.1.1 Imbue Limitations ...........................................................................................................................59927.1.2 Positioning Type Limitations .........................................................................................................59927.2 Forward declarations..........................................................................................................................59927.3 Standard iostream objects ..................................................................................................................60227.3.1 Narrow stream objects ....................................................................................................................60227.3.2 Wide stream objects ........................................................................................................................60327.4 Iostreams base classes ........................................................................................................................60427.4.1 Types...............................................................................................................................................60427.4.2 Class ios_base ...........................................................................................................................60527.4.2.1 Types............................................................................................................................................60727.4.2.1.1 Class ios_base::failure................................................................................................60727.4.2.1.2 Type ios_base::fmtflags..............................................................................................60727.4.2.1.3 Type ios_base::iostate ................................................................................................60827.4.2.1.4 Type ios_base::openmode..............................................................................................60927.4.2.1.5 Type ios_base::seekdir ................................................................................................60927.4.2.1.6 Class ios_base::Init .......................................................................................................60927.4.2.2 ios_base fmtflags state functions ....................................................................................610xxiISO/IEC 14882:1998(E)© ISO/IEC27.4.2.3 ios_base locale functions .................................................................................................61127.4.2.4 ios_base static members .........................................................................................................61127.4.2.5 ios_base storage functions ......................................................................................................61127.4.2.6 ios_base callbacks ..................................................................................................................61227.4.2.7 ios_base constructors/destructors ...........................................................................................61227.4.3 Template class fpos......................................................................................................................61227.4.3.1 fpos Members............................................................................................................................61227.4.3.2 fpos requirements ......................................................................................................................61227.4.4 Template class basic_ios..........................................................................................................61327.4.4.1 basic_ios constructors ...........................................................................................................61427.4.4.2 Member functions ........................................................................................................................61527.4.4.3 basic_ios iostate flags functions ....................................................................................61627.4.5 ios_base manipulators ...............................................................................................................61727.4.5.1 fmtflags manipulators ............................................................................................................61727.4.5.2 adjustfield manipulators .....................................................................................................61827.4.5.3 basefield manipulators ..........................................................................................................61927.4.5.4 floatfield manipulators .......................................................................................................61927.5 Stream buffers ....................................................................................................................................61927.5.1 Stream buffer requirements ............................................................................................................62027.5.2 Template class basic_streambuf<charT,traits>..........................................................62027.5.2.1 basic_streambuf constructors .............................................................................................62227.5.2.2 basic_streambuf public member functions ........................................................................62327.5.2.2.1 Locales ......................................................................................................................................62327.5.2.2.2 Buffer management and positioning .........................................................................................62327.5.2.2.3 Get area .....................................................................................................................................62327.5.2.2.4 Putback .....................................................................................................................................62427.5.2.2.5 Put area .....................................................................................................................................62427.5.2.3 basic_streambuf protected member functions....................................................................62427.5.2.3.1 Get area access ..........................................................................................................................62427.5.2.3.2 Put area access ..........................................................................................................................62527.5.2.4 basic_streambuf virtual functions ......................................................................................62527.5.2.4.1 Locales ......................................................................................................................................62527.5.2.4.2 Buffer management and positioning .........................................................................................62527.5.2.4.3 Get area .....................................................................................................................................62627.5.2.4.4 Putback .....................................................................................................................................62727.5.2.4.5 Put area .....................................................................................................................................62827.6 Formatting and manipulators .............................................................................................................62927.6.1 Input streams ...................................................................................................................................63027.6.1.1 Template class basic_istream .............................................................................................63027.6.1.1.1 basic_istream constructors...............................................................................................63227.6.1.1.2 Class basic_istream::sentry ......................................................................................63227.6.1.2 Formatted input functions ............................................................................................................63327.6.1.2.1 Common requirements..............................................................................................................63327.6.1.2.2 Arithmetic Extractors................................................................................................................63327.6.1.2.3 basic_istream::operator>> ......................................................................................63427.6.1.3 Unformatted input functions ........................................................................................................63527.6.1.4 Standard basic_istream manipulators .................................................................................63927.6.1.5 Template class basic_iostream...........................................................................................63927.6.1.5.1 basic_iostream constructors ............................................................................................64027.6.1.5.2 basic_iostream destructor ................................................................................................64027.6.2 Output streams ................................................................................................................................64027.6.2.1 Template class basic_ostream .............................................................................................640xxii© ISO/IECISO/IEC 14882:1998(E)27.6.2.2 basic_ostream constructors..................................................................................................64227.6.2.3 Class basic_ostream::sentry .........................................................................................64227.6.2.4 basic_ostream seek members ..............................................................................................64327.6.2.5 Formatted output functions ..........................................................................................................64327.6.2.5.1 Common requirements..............................................................................................................64327.6.2.5.2 Arithmetic Inserters ..................................................................................................................64327.6.2.5.3 basic_ostream::operator<< ......................................................................................64427.6.2.5.4 Character inserter template functions .......................................................................................64527.6.2.6 Unformatted output functions ......................................................................................................64527.6.2.7 Standard basic_ostream manipulators .................................................................................64627.6.3 Standard manipulators ....................................................................................................................64627.7 String-based streams ..........................................................................................................................64827.7.1 Template class basic_stringbuf ...........................................................................................64927.7.1.1 basic_stringbuf constructors .............................................................................................65027.7.1.2 Member functions ........................................................................................................................65027.7.1.3 Overridden virtual functions ........................................................................................................65127.7.2 Template class basic_istringstream..................................................................................65327.7.2.1 basic_istringstream constructors ...................................................................................65327.7.2.2 Member functions ........................................................................................................................65427.7.3 Class basic_ostringstream .................................................................................................65427.7.3.1 basic_ostringstream constructors ...................................................................................65527.7.3.2 Member functions ........................................................................................................................65527.7.4 Template class basic_stringstream ....................................................................................65527.7.5 basic_stringstream constructors ......................................................................................................65627.7.6 Member functions ...........................................................................................................................65627.8 File-based streams .............................................................................................................................65727.8.1 File streams .....................................................................................................................................65727.8.1.1 Template class basic_filebuf .............................................................................................65727.8.1.2 basic_filebuf constructors..................................................................................................65827.8.1.3 Member functions ........................................................................................................................65927.8.1.4 Overridden virtual functions ........................................................................................................66027.8.1.5 Template class basic_ifstream...........................................................................................66227.8.1.6 basic_ifstream constructors ...............................................................................................66327.8.1.7 Member functions ........................................................................................................................66327.8.1.8 Template class basic_ofstream...........................................................................................66427.8.1.9 basic_ofstream constructors ...............................................................................................66427.8.1.10 Member functions ......................................................................................................................66527.8.1.11 Template class basic_fstream ...........................................................................................66527.8.1.12 basic_fstream constructors................................................................................................66627.8.1.13 Member functions ......................................................................................................................66627.8.2 C Library files .................................................................................................................................666Annex A (informative) Grammar summary ..............................................................................................667A.1 Keywords ............................................................................................................................................667A.2 Lexical conventions ............................................................................................................................667A.3 Basic concepts.....................................................................................................................................671A.4 Expressions .........................................................................................................................................671xxiiiISO/IEC 14882:1998(E)© ISO/IECA.5 Statements ...........................................................................................................................................674A.6 Declarations ........................................................................................................................................675A.7 Declarators ..........................................................................................................................................677A.8 Classes ................................................................................................................................................679A.9 Derived classes....................................................................................................................................680A.10 Special member functions .................................................................................................................680A.11 Overloading ......................................................................................................................................680A.12 Templates ..........................................................................................................................................681A.13 Exception handling ...........................................................................................................................681A.14 Preprocessing directives....................................................................................................................682Annex B (informative) Implementation quantities ....................................................................................685Annex C (informative)Compatibility .......................................................................................................687C.1 C++ and ISO C ....................................................................................................................................687C.1.1 Clause 2: lexical conventions ...........................................................................................................687C.1.2 Clause 3: basic concepts ..................................................................................................................688C.1.3 Clause 5: expressions .......................................................................................................................690C.1.4 Clause 6: statements .........................................................................................................................690C.1.5 Clause 7: declarations ......................................................................................................................691C.1.6 Clause 8: declarators ........................................................................................................................693C.1.7 Clause 9: classes...............................................................................................................................694C.1.8 Clause 12: special member functions...............................................................................................695C.1.9 Clause 16: preprocessing directives .................................................................................................696C.2 Standard C library ...............................................................................................................................696C.2.1 Modifications to headers ..................................................................................................................698C.2.2 Modifications to definitions .............................................................................................................698C.2.2.1 Type wchar_t.............................................................................................................................698C.2.2.2 Header <iso646.h> ..................................................................................................................699C.2.2.3 Macro NULL..................................................................................................................................699C.2.3 Modifications to declarations ...........................................................................................................699C.2.4 Modifications to behavior ................................................................................................................699C.2.4.1 Macro offsetof(type, member-designator) ............................................................699C.2.4.2 Memory allocation functions ........................................................................................................699Annex D (normative)D.1Compatibility features ............................................................................................701Postfix increment operator ..................................................................................................................701D.2 static keyword .....................................................................................................................................701D.3 Access declarations .............................................................................................................................701xxiv© ISO/IECD.4ISO/IEC 14882:1998(E)Implicit conversion from const strings ...............................................................................................701D.5 Standard C library headers ..................................................................................................................701D.6 Old iostreams members ......................................................................................................................701D.7 char* streams ...................................................................................................................................703D.7.1 Class strstreambuf ...................................................................................................................703D.7.1.1 strstreambuf constructors .....................................................................................................705D.7.1.2 Member functions .........................................................................................................................706D.7.1.3 strstreambuf overridden virtual functions ............................................................................706D.7.2 Class istrstream........................................................................................................................709D.7.2.1 istrstream constructors ..........................................................................................................709D.7.2.2 Member functions .........................................................................................................................709D.7.3 Class ostrstream........................................................................................................................710D.7.3.1 ostrstream constructors ..........................................................................................................710D.7.3.2 Member functions .........................................................................................................................710D.7.4 Class strstream ..........................................................................................................................711D.7.4.1 strstream constructors ............................................................................................................711D.7.4.2 strstream destructor ................................................................................................................712D.7.4.3 strstream operations ...............................................................................................................712Annex E (normative) Universal-character-names .....................................................................................713Index .............................................................................................................................................................715xxvISO/IEC 14882:1998(E)©ISO/IECForewordISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwidestandardization.

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
5209
Авторов
на СтудИзбе
430
Средний доход
с одного платного файла
Обучение Подробнее