1S01EC148822003E) 26.3.5.1 s1ice_array constructors 592 26.3.5.2 slice_array assignmemt 592 26.3.5.3 81ice_array compued assignment.... 592 26.3.5.4 slice_array fill function. 593 26.3.6 The galice class.... 593 26.3.6.1 gslice constructors 594 26.3.6.2 ga1ice access functions 594 26.3.7 Class templae gslice_array 594 26.3.7.1 gslice_array constructors. 595 26.3.7.2 gslice_array assignment. 595 26.3.7.3 gslica array conputed asaigrmant 595 26.3.7.4 gslice_array fill function 596 26.3.8 Class templae maskarray 596 26.3.8.1 mask array constructors. 596 26.3.8 2 mask array assignmemt 59% 26.3.8.3 mask array compuled assigrment............. 597 26.3.8.4 mask array fill function 597 26.3.9 Class templae indirect array...... 597 26.3.9.1 indireet_array constructors. 598 26.3.92 indirect array assignment. 598 26.3.9.3 indirect array computed assignment.... 598 26.3.9.4 indirect_array fill function.... 599 26.4 Generalized numeric operations 599 26.4.I Accurmilate. 599 26.4.2 Inner product..... 600 26.4.3Pati过sum. 600 26.4.4 Adjacent difference 601 26.5 C Library… 601 27【npu/output libeary 605 27.1 lostreams requirements. 605 27.1.1 lmbue Limitations. 605 27.1.2 Positioning Type Limitations 605 27.2 Forward declarations. 605 27.3 Standard iostream objects 608 27.3.1 Narrow stream objects 608 27.3.2 Wide stream objects. 609 27.4 lostreams base classes.. 610 274.1 Types 610 27.4.2 Class ios_base 611 27.42.1Tps… 613 27.4.2.1.1 Class ios base:tailure. 613 27.4.2.1.2 Type ios_base:fntflags 613 27.4.2.1.3 Type ios_base:iostate. 614 2742.14Te1e8ba8●::apenmode. 615 27.4.2.1.5 Type ios_base:seekdir 615 27.4.2.1.6 Class ios basetiInit. 615 27.4.22 1os_base fntflaga state functioes ...... 616 XXE eS0MEC20a一Aarights neserved
ISO/IEC 14882:2003(E) xxii © ISO/IEC 2003 — All rights reserved 26.3.5.1 slice_array constructors ......................................................................................................592 26.3.5.2 slice_array assignment ........................................................................................................592 26.3.5.3 slice_array computed assignment .......................................................................................592 26.3.5.4 slice_array fill function .......................................................................................................593 26.3.6 The gslice class ..........................................................................................................................593 26.3.6.1 gslice constructors........................................................................................................594 26.3.6.2 gslice access functions ............................................................................................................594 26.3.7 Class template gslice_array...................................................................................................594 26.3.7.1 gslice_array constructors ....................................................................................................595 26.3.7.2 gslice_array assignment......................................................................................................595 26.3.7.3 gslice_array computed assignment.........................................................................595 26.3.7.4 gslice_array fill function.....................................................................................................596 26.3.8 Class template mask_array........................................................................................................596 26.3.8.1 mask_array constructors .........................................................................................................596 26.3.8.2 mask_array assignment ..........................................................................................................596 26.3.8.3 mask_array computed assignment..........................................................................................597 26.3.8.4 mask_array fill function .........................................................................................................597 26.3.9 Class template indirect_array ..............................................................................................597 26.3.9.1 indirect_array constructors ...............................................................................................598 26.3.9.2 indirect_array assignment .................................................................................................598 26.3.9.3 indirect_array computed assignment ................................................................................598 26.3.9.4 indirect_array fill function ................................................................................................599 26.4 Generalized numeric operations ........................................................................................................599 26.4.1 Accumulate .....................................................................................................................................599 26.4.2 Inner product ...................................................................................................................................600 26.4.3 Partial sum ......................................................................................................................................600 26.4.4 Adjacent difference .........................................................................................................................601 26.5 C Library ............................................................................................................................................601 27 Input/output library ...............................................................................................................................605 27.1 Iostreams requirements ......................................................................................................................605 27.1.1 Imbue Limitations ...........................................................................................................................605 27.1.2 Positioning Type Limitations .........................................................................................................605 27.2 Forward declarations..........................................................................................................................605 27.3 Standard iostream objects ..................................................................................................................608 27.3.1 Narrow stream objects ....................................................................................................................608 27.3.2 Wide stream objects ........................................................................................................................609 27.4 Iostreams base classes ........................................................................................................................610 27.4.1 Types...............................................................................................................................................610 27.4.2 Class ios_base ...........................................................................................................................611 27.4.2.1 Types............................................................................................................................................613 27.4.2.1.1 Class ios_base::failure................................................................................................613 27.4.2.1.2 Type ios_base::fmtflags..............................................................................................613 27.4.2.1.3 Type ios_base::iostate ................................................................................................614 27.4.2.1.4 Type ios_base::openmode..............................................................................................615 27.4.2.1.5 Type ios_base::seekdir ................................................................................................615 27.4.2.1.6 Class ios_base::Init.......................................................................................................615 27.4.2.2 ios_base fmtflags state functions ....................................................................................616
I501EC14882:2003(曰 27423 ios_base locale functions. .616 274 24 ios base static members........... .617 27425 1os_base storuge functions. .617 274 26 ios base callhacks 27.4 2.7 ios_base constructors/destructors. .618 2743 Claees template fpos 994,618 27.4 3.1 fpos Members 274 3.2 Epos requiremens.. 618 27.4.4 Class template basicos.......... 619 27441白a81G1080n05i1i 620 27.4.42 Member functions. 62 2744.3 basie_ios iostate flags functions .622 274 5 1os base manipulators............ 623 274 5.1 Entflags mnipulalors.......... 623 274 52 adjustfield manpulators........... .624 274 53 basefseld manipulmors..... 625 27.454 floatfield manipulators......... 625 275 Stream buffers. 625 27 5.1 Stream buffer requirements 2752 Class template basic_streanbuf<charT,traits> 626 2752.1 basie_streambuf constructors.. 628 27 522 basic streambuf public member functions .629 275 2 2.1 Locales.. 444444444444444444444444 444444444444444444444444444 .629 27 5 22 2 Buffer management and positioning 629 275223 Get area 275224 Putback 630 27522.5Pl .630 27523 basicatreambf protected member finctions 630 275231 Get area a005 4444444444444444444444 275232 Put area access 63 27 524 baaie_atreambuf virtual functions 631 27524.11.0 cales 275242 Buffer management and positioning. .631 275243 Get area 632 27 5 24 4 Puthack 633 2752.4.5 Putarea 634 276 Formatting and manipulators. 633 276.1 Input streams 4636 27.6.1.1 Claes template basicistrean. 636 276.1.1.1 basie istream constructors. 2761.1.2 Claxs basie Iatream:sentry 276.1.2 Formatted input functions............ ..639 276.121 Common requirements. .639 276 12 2 Arithmetic Extractos 276.123 basic_istream::operator>> 640 276.13 Unformatted input functiors........... 64 276.1.4 Standard basic istream manipulators ..643 27.6.1.5 Class template basic_iostream. 276.1.5.1 basic iostrean constructors 646 276152 与am1e108tx0andu0f 11646 2762 Output streams 646 27.621 Class template basic_ostream 646 。50EC2003-Mg修eserved XX量
ISO/IEC 14882:2003(E) © ISO/IEC 2003 — All rights reserved xxiii 27.4.2.3 ios_base locale functions .................................................................................................616 27.4.2.4 ios_base static members .........................................................................................................617 27.4.2.5 ios_base storage functions ......................................................................................................617 27.4.2.6 ios_base callbacks ..................................................................................................................618 27.4.2.7 ios_base constructors/destructors ...........................................................................................618 27.4.3 Class template fpos ......................................................................................................................618 27.4.3.1 fpos Members ............................................................................................................................618 27.4.3.2 fpos requirements ......................................................................................................................618 27.4.4 Class template basic_ios ..........................................................................................................619 27.4.4.1 basic_ios constructors ...........................................................................................................620 27.4.4.2 Member functions ........................................................................................................................621 27.4.4.3 basic_ios iostate flags functions ....................................................................................622 27.4.5 ios_base manipulators ...............................................................................................................623 27.4.5.1 fmtflags manipulators ............................................................................................................623 27.4.5.2 adjustfield manipulators .....................................................................................................624 27.4.5.3 basefield manipulators ..........................................................................................................625 27.4.5.4 floatfield manipulators .......................................................................................................625 27.5 Stream buffers ....................................................................................................................................625 27.5.1 Stream buffer requirements ............................................................................................................626 27.5.2 Class template basic_streambuf<charT,traits> ..........................................................626 27.5.2.1 basic_streambuf constructors .............................................................................................628 27.5.2.2 basic_streambuf public member functions ........................................................................629 27.5.2.2.1 Locales ......................................................................................................................................629 27.5.2.2.2 Buffer management and positioning .........................................................................................629 27.5.2.2.3 Get area .....................................................................................................................................629 27.5.2.2.4 Putback .....................................................................................................................................630 27.5.2.2.5 Put area .....................................................................................................................................630 27.5.2.3 basic_streambuf protected member functions....................................................................630 27.5.2.3.1 Get area access ..........................................................................................................................630 27.5.2.3.2 Put area access ..........................................................................................................................631 27.5.2.4 basic_streambuf virtual functions ......................................................................................631 27.5.2.4.1 Locales ......................................................................................................................................631 27.5.2.4.2 Buffer management and positioning .........................................................................................631 27.5.2.4.3 Get area .....................................................................................................................................632 27.5.2.4.4 Putback .....................................................................................................................................633 27.5.2.4.5 Put area .....................................................................................................................................634 27.6 Formatting and manipulators .............................................................................................................635 27.6.1 Input streams ...................................................................................................................................636 27.6.1.1 Class template basic_istream..............................................................................................636 27.6.1.1.1 basic_istream constructors...............................................................................................638 27.6.1.1.2 Class basic_istream::sentry ......................................................................................638 27.6.1.2 Formatted input functions ............................................................................................................639 27.6.1.2.1 Common requirements..............................................................................................................639 27.6.1.2.2 Arithmetic Extractors................................................................................................................639 27.6.1.2.3 basic_istream::operator>> ......................................................................................640 27.6.1.3 Unformatted input functions ........................................................................................................641 27.6.1.4 Standard basic_istream manipulators .................................................................................645 27.6.1.5 Class template basic_iostream ...........................................................................................646 27.6.1.5.1 basic_iostream constructors ............................................................................................646 27.6.1.5.2 basic_iostream destructor ................................................................................................646 27.6.2 Output streams ................................................................................................................................646 27.6.2.1 Class template basic_ostream..............................................................................................646
1S01EC148822003E) 27.6.2.2 basle_oatream constructors. 648 27.6.2.3 Class basic ostrean:sentry......... 648 27.6.2.4 basic_ostream seek members............. 649 27.6.2.5 Formatted output functions................ 650 27.6.2.5.1 Common requirements 650 27.6.2.52 Arithmetic Ireerters. .650 27.6.2.5.3 basle oatream::operator<c.... .630 27.6.2.5.4 Character inserer function templates..... 631 27.6.2.6 Unformated output functions.................... 652 27.6.2.7 Standard basic_ostrean manipulators. .653 27.6.3 Standard manipulators 653 27.7 String-based strcams 655 27.7.I Class template basic stringbuf......... 656 27.7.1.1 basie stringbuf corstruclors.......... .657 27.7.1.2 Member functions 657 27.7.1.3 Overridden virtual functions.... 658 27.7.2 Class template basic istringatream 660 27.7.2.1 basic istringstrean construclors. 660 27.7.2.2 Member functions 661 27.7.3 Class basie ostringtra 661 27.7.3.1 basic_ostringstrean construclors 662 27.7.3.2 Member functions 662 27.7.4 Class template basie stringstrean..... 662 27.7.5 basie stringstream coesruclors 663 27.7.6 Member functions. 663 27.8 File-based streams 664 27.8.1 Fie streams... 664 27.8.1.1 Class template basicb 664 27.8.1.2 basie filebuf constructoes.. 665 27.8.1.3 Member functions. 666 27.8.1.4 Overridden virtual functions..... 667 27.8.1.5 Class template basic ifstream.. 669 27.8.1.6 basic_ifstream constrctors. 670 27.8.1.7 Member functions 670 27.8.1.8 Class template basicofstream..... 671 27.8.1.9 basie ofatream constnuctors............ 671 27.8.1.10 Member functions. 672 27.8.1.11 Class template basic fstrean...... 672 27.8.1.12 basic fstream consiructors.............. 673 27.8.1.13 Member functions .673 27.8.2 C Library fikes. 673 Annex A (informative)Grammar summary .... 675 A1 Keywor小at 675 A 2 Lexical comventioess 675 A.3 Basie concepts. .679 A.4 Expressions.... 679 xxiv ISOEC0a如一相htws4ned
ISO/IEC 14882:2003(E) xxiv © ISO/IEC 2003 — All rights reserved 27.6.2.2 basic_ostream constructors..................................................................................................648 27.6.2.3 Class basic_ostream::sentry .........................................................................................648 27.6.2.4 basic_ostream seek members ..............................................................................................649 27.6.2.5 Formatted output functions ..........................................................................................................650 27.6.2.5.1 Common requirements..............................................................................................................650 27.6.2.5.2 Arithmetic Inserters ..................................................................................................................650 27.6.2.5.3 basic_ostream::operator<< ......................................................................................650 27.6.2.5.4 Character inserter function templates .......................................................................................651 27.6.2.6 Unformatted output functions ......................................................................................................652 27.6.2.7 Standard basic_ostream manipulators .................................................................................653 27.6.3 Standard manipulators ....................................................................................................................653 27.7 String-based streams ..........................................................................................................................655 27.7.1 Class template basic_stringbuf............................................................................................656 27.7.1.1 basic_stringbuf constructors .............................................................................................657 27.7.1.2 Member functions ........................................................................................................................657 27.7.1.3 Overridden virtual functions ........................................................................................................658 27.7.2 Class template basic_istringstream ..................................................................................660 27.7.2.1 basic_istringstream constructors ...................................................................................660 27.7.2.2 Member functions ........................................................................................................................661 27.7.3 Class basic_ostringstream.................................................................................................661 27.7.3.1 basic_ostringstream constructors ...................................................................................662 27.7.3.2 Member functions ........................................................................................................................662 27.7.4 Class template basic_stringstream.....................................................................................662 27.7.5 basic_stringstream constructors ......................................................................................................663 27.7.6 Member functions ...........................................................................................................................663 27.8 File-based streams .............................................................................................................................664 27.8.1 File streams .....................................................................................................................................664 27.8.1.1 Class template basic_filebuf..............................................................................................664 27.8.1.2 basic_filebuf constructors..................................................................................................665 27.8.1.3 Member functions ........................................................................................................................666 27.8.1.4 Overridden virtual functions ........................................................................................................667 27.8.1.5 Class template basic_ifstream ...........................................................................................669 27.8.1.6 basic_ifstream constructors ...............................................................................................670 27.8.1.7 Member functions ........................................................................................................................670 27.8.1.8 Class template basic_ofstream ...........................................................................................671 27.8.1.9 basic_ofstream constructors ...............................................................................................671 27.8.1.10 Member functions ......................................................................................................................672 27.8.1.11 Class template basic_fstream............................................................................................672 27.8.1.12 basic_fstream constructors................................................................................................673 27.8.1.13 Member functions ......................................................................................................................673 27.8.2 C Library files .................................................................................................................................673 Annex A (informative) Grammar summary ..............................................................................................675 A.1 Keywords ............................................................................................................................................675 A.2 Lexical conventions ............................................................................................................................675 A.3 Basic concepts.....................................................................................................................................679 A.4 Expressions .........................................................................................................................................679
1s01EC14882:2003(曰 A5 Statements. …682 A6 Declarations A7 Declarators. 685 A8 Classes 687 A9 Derived classes. :688 A.10 Special member functions .688 A11 Overlooding 688 A.12 Templates .689 A.13 Exception handling .689 A14 Preprocessing directive Anex B(informative)Implementation quantities 4693 Anex C (infoemative)Compatibility C.I G+and ISo C. C.1.I Clause 2 lexical conventions......... .695 C.1.2 Clause 3:basic conoepts 696 C.1.3 Clause 5:expressions. 44698 C.1.4 Clause 6 statements 44699 C.1.5 Clause 7:declarations ...699 C.1.6 Clause 8 declarators 701 C.1.7 Clause 9 classes 702 C.1.8 Clause 12:special member functions. 703 C.1.9 Clause 16c preprocessing directives.... 70 C.2 Standard C library. 704 C.2.1 Modifications to headers 94706 C.2.2 Modifications to definitions............. 706 C.22.1 Type vehar t 705 C.2.22 Header <1so646.h>.... …707 C.2.2.3 Macro NULL t4t707 C.2.3 Modifications to declarations......... 707 C.2.4 Modifications to behavior..... 707 C.2.4.1 Macro offsetof(type,nember-designator) 4707 C.2.4.2 Memtory allocation functions. Annex D(normative)Compatibility features. 709 D.1 Increment operator with bool operand D2 statie keyword 709 D3 Access declara减ios 709 QIS0EC2003一All rights reserved xXV
ISO/IEC 14882:2003(E) © ISO/IEC 2003 — All rights reserved xxv A.5 Statements ...........................................................................................................................................682 A.6 Declarations ........................................................................................................................................683 A.7 Declarators ..........................................................................................................................................685 A.8 Classes ................................................................................................................................................687 A.9 Derived classes....................................................................................................................................688 A.10 Special member functions .................................................................................................................688 A.11 Overloading ......................................................................................................................................688 A.12 Templates ..........................................................................................................................................689 A.13 Exception handling ...........................................................................................................................689 A.14 Preprocessing directives....................................................................................................................690 Annex B (informative) Implementation quantities ....................................................................................693 Annex C (informative) Compatibility .......................................................................................................695 C.1 C + + and ISO C .....................................................................................................................................695 C.1.1 Clause 2: lexical conventions ...........................................................................................................695 C.1.2 Clause 3: basic concepts ..................................................................................................................696 C.1.3 Clause 5: expressions .......................................................................................................................698 C.1.4 Clause 6: statements .........................................................................................................................699 C.1.5 Clause 7: declarations ......................................................................................................................699 C.1.6 Clause 8: declarators ........................................................................................................................701 C.1.7 Clause 9: classes...............................................................................................................................702 C.1.8 Clause 12: special member functions...............................................................................................703 C.1.9 Clause 16: preprocessing directives .................................................................................................704 C.2 Standard C library ...............................................................................................................................704 C.2.1 Modifications to headers ..................................................................................................................706 C.2.2 Modifications to definitions .............................................................................................................706 C.2.2.1 Type wchar_t.............................................................................................................................706 C.2.2.2 Header <iso646.h> ..................................................................................................................707 C.2.2.3 Macro NULL..................................................................................................................................707 C.2.3 Modifications to declarations ...........................................................................................................707 C.2.4 Modifications to behavior ................................................................................................................707 C.2.4.1 Macro offsetof(type, member-designator)............................................................707 C.2.4.2 Memory allocation functions ........................................................................................................707 Annex D (normative) Compatibility features ............................................................................................709 D.1 Increment operator with bool operand .............................................................................................709 D.2 static keyword .....................................................................................................................................709 D.3 Access declarations .............................................................................................................................709
1S01EC148822003E) D.4 Implicit conversion from const strings 709 D5 Standard C library headers. 709 D.6 Old iostreams members 709 D.7 char*streams....... D.7.1 Class strstreambuf. 4444444444444444+44 4444444444444444444444 711 D7.11 strstreambuf constructors..................... 713 D.7.12 Member functions 714 D.7.1 3 strstreambuf overidden virtual functions 714 D.72 Class istratream 717 D.72.1 1 strstr0anC0c减uCl05 717 D722 Member functions 717 D.73 Class ostrstream. 718 D.73.1 ostratrean comstructors. 718 D.7_32 Member functions 718 D.74 Class strstream. 719 D.7.4.1 strstream constructors 719 D.7.42 stratream destructor. 720 D.743 strstream operations 720 Annex E (normative)Universal-character-names 21 Index 723 M ●S0NEC20ag-A相phts neserved
ISO/IEC 14882:2003(E) xxvi © ISO/IEC 2003 — All rights reserved D.4 Implicit conversion from const strings ...............................................................................................709 D.5 Standard C library headers ..................................................................................................................709 D.6 Old iostreams members ......................................................................................................................709 D.7 char* streams ...................................................................................................................................711 D.7.1 Class strstreambuf...................................................................................................................711 D.7.1.1 strstreambuf constructors .....................................................................................................713 D.7.1.2 Member functions .........................................................................................................................714 D.7.1.3 strstreambuf overridden virtual functions ............................................................................714 D.7.2 Class istrstream........................................................................................................................717 D.7.2.1 istrstream constructors ..........................................................................................................717 D.7.2.2 Member functions .........................................................................................................................717 D.7.3 Class ostrstream........................................................................................................................718 D.7.3.1 ostrstream constructors ..........................................................................................................718 D.7.3.2 Member functions .........................................................................................................................718 D.7.4 Class strstream ..........................................................................................................................719 D.7.4.1 strstream constructors ............................................................................................................719 D.7.4.2 strstream destructor ................................................................................................................720 D.7.4.3 strstream operations ...............................................................................................................720 Annex E (normative) Universal-character-names .....................................................................................721 Index .............................................................................................................................................................723