libstdc++-manual

  • Upload
    rrs1988

  • View
    64

  • Download
    0

Embed Size (px)

DESCRIPTION

Theory related to libstdc++

Citation preview

  • The GNU C++ Library Manuali

    The GNU C++ Library Manual

  • The GNU C++ Library Manualii

    Copyright 2009, 2010 FSF

    License

  • The GNU C++ Library Manualiii

    COLLABORATORS

    TITLE :

    The GNU C++ Library Manual

    ACTION NAME DATE SIGNATURE

    WRITTEN BY February 1, 2011

    REVISION HISTORY

    NUMBER DATE DESCRIPTION NAME

  • The GNU C++ Library Manualiv

    Contents

    I Introduction 1

    1 Status 2

    1.1 Implementation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.1.1 C++ 1998/2003 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.1.1.1 Implementation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.1.1.2 Implementation Specific Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.1.2 C++ 200x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.1.3 C++ TR1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.1.4 C++ TR 24733 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.2 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.2.1 The Code: GPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    1.2.2 The Documentation: GPL, FDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    1.3 Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    1.3.1 Implementation Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    1.3.2 Standard Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    2 Setup 14

    2.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.2 Configure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    2.3 Make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    3 Using 19

    3.1 Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    3.2 Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    3.2.1 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    3.2.2 Mixing Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    3.2.3 The C Headers and namespace std . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    3.2.4 Precompiled Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    3.3 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

  • The GNU C++ Library Manualv

    3.4 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    3.4.1 Available Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    3.4.2 namespace std . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    3.4.3 Using Namespace Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    3.5 Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    3.5.1 Almost Nothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    3.5.2 Finding Dynamic or Shared Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    3.6 Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    3.6.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    3.6.2 Thread Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    3.6.3 Atomics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    3.6.4 IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    3.6.4.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    3.6.4.2 Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    3.6.4.3 Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    3.6.4.4 Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    3.6.5 Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    3.7 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    3.7.1 Exception Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    3.7.2 Exception Neutrality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    3.7.3 Doing without . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    3.7.4 Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    3.7.4.1 With C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    3.7.4.2 With POSIX thread cancellation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    3.7.5 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    3.8 Debugging Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    3.8.1 Using g++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    3.8.2 Debug Versions of Library Binary Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    3.8.3 Memory Leak Hunting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    3.8.4 Data Race Hunting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    3.8.5 Using gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    3.8.6 Tracking uncaught exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    3.8.7 Debug Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    3.8.8 Compile Time Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    3.8.9 Profile-based Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

  • The GNU C++ Library Manualvi

    II Standard Contents 36

    4 Support 37

    4.1 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    4.1.1 Fundamental Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    4.1.2 Numeric Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    4.1.3 NULL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    4.2 Dynamic Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    4.3 Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    4.3.1 Termination Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    4.3.2 Verbose Terminate Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    5 Diagnostics 42

    5.1 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    5.1.1 API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    5.1.2 Adding Data to exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    5.2 Concept Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    6 Utilities 44

    6.1 Functors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    6.2 Pairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    6.3 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    6.3.1 Allocators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    6.3.1.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    6.3.1.2 Design Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    6.3.1.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.3.1.3.1 Interface Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.3.1.3.2 Selecting Default Allocation Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.3.1.3.3 Disabling Memory Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    6.3.1.4 Using a Specific Allocator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    6.3.1.5 Custom Allocators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    6.3.1.6 Extension Allocators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    6.3.1.7 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    6.3.2 auto_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    6.3.2.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    6.3.2.2 Use in Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    6.3.3 shared_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    6.3.3.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    6.3.3.2 Design Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    6.3.3.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

  • The GNU C++ Library Manualvii

    6.3.3.3.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    6.3.3.3.2 Thread Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    6.3.3.3.3 Selecting Lock Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    6.3.3.3.4 Dual C++0x and TR1 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 52

    6.3.3.3.5 Related functions and classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    6.3.3.4 Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    6.3.3.4.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    6.3.3.4.2 Unresolved Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    6.3.3.5 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    6.3.3.6 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    6.4 Traits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    7 Strings 54

    7.1 String Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    7.1.1 Simple Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    7.1.2 Case Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    7.1.3 Arbitrary Character Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    7.1.4 Tokenizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    7.1.5 Shrink to Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    7.1.6 CString (MFC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    8 Localization 60

    8.1 Locales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    8.1.1 locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    8.1.1.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    8.1.1.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    8.1.1.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    8.1.1.3.1 Interacting with "C" locales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    8.1.1.4 Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    8.1.1.5 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    8.2 Facets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    8.2.1 ctype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    8.2.1.1 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    8.2.1.1.1 Specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    8.2.1.2 Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    8.2.1.3 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    8.2.2 codecvt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    8.2.2.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    8.2.2.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

  • The GNU C++ Library Manualviii

    8.2.2.2.1 wchar_t Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    8.2.2.2.2 Support for Unicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    8.2.2.2.3 Other Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    8.2.2.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

    8.2.2.4 Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    8.2.2.5 Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    8.2.2.6 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

    8.2.3 messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

    8.2.3.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

    8.2.3.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

    8.2.3.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

    8.2.3.3.1 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

    8.2.3.3.2 The GNU Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

    8.2.3.4 Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

    8.2.3.5 Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    8.2.3.6 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    9 Containers 76

    9.1 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    9.1.1 list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    9.1.1.1 list::size() is O(n) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    9.1.2 vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    9.1.2.1 Space Overhead Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    9.2 Associative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    9.2.1 Insertion Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    9.2.2 bitset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    9.2.2.1 Size Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    9.2.2.2 Type String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

    9.3 Interacting with C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    9.3.1 Containers vs. Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    10 Iterators 81

    10.1 Predefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

    10.1.1 Iterators vs. Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

    10.1.2 One Past the End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

    11 Algorithms 83

    11.1 Mutating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    11.1.1 swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    11.1.1.1 Specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

  • The GNU C++ Library Manualix

    12 Numerics 84

    12.1 Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    12.1.1 complex Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    12.2 Generalized Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    12.3 Interacting with C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    12.3.1 Numerics vs. Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    12.3.2 C99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    13 Input and Output 86

    13.1 Iostream Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    13.2 Stream Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    13.2.1 Derived streambuf Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    13.2.2 Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    13.3 Memory Based Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    13.3.1 Compatibility With strstream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    13.4 File Based Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    13.4.1 Copying a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    13.4.2 Binary Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    13.5 Interacting with C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    13.5.1 Using FILE* and file descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    13.5.2 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

    14 Atomics 93

    14.1 API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    15 Concurrency 94

    15.1 API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    III Extensions 95

    16 Compile Time Checks 97

    17 Debug Mode 98

    17.1 Intro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    17.2 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    17.3 Using . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    17.3.1 Using the Debug Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    17.3.2 Using a Specific Debug Container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    17.4 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    17.4.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    17.4.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

  • The GNU C++ Library Manualx

    17.4.2.1 The Wrapper Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    17.4.2.1.1 Safe Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    17.4.2.1.2 Safe Sequences (Containers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    17.4.2.2 Precondition Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    17.4.2.3 Release- and debug-mode coexistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    17.4.2.3.1 Compile-time coexistence of release- and debug-mode components . . . . . . . . . . 103

    17.4.2.3.2 Link- and run-time coexistence of release- and debug-mode components . . . . . . . 104

    17.4.2.3.3 Alternatives for Coexistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    17.4.3 Other Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

    18 Parallel Mode 107

    18.1 Intro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

    18.2 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    18.3 Using . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    18.3.1 Prerequisite Compiler Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    18.3.2 Using Parallel Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

    18.3.3 Using Specific Parallel Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

    18.4 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

    18.4.1 Interface Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

    18.4.2 Configuration and Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

    18.4.2.1 Setting up the OpenMP Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

    18.4.2.2 Compile Time Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

    18.4.2.3 Run Time Settings and Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

    18.4.3 Implementation Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    18.5 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    18.6 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    19 Profile Mode 114

    19.1 Intro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

    19.1.1 Using the Profile Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

    19.1.2 Tuning the Profile Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

    19.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    19.2.1 Wrapper Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    19.2.2 Instrumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    19.2.3 Run Time Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    19.2.4 Analysis and Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    19.2.5 Cost Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    19.2.6 Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    19.2.7 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

  • The GNU C++ Library Manualxi

    19.3 Extensions for Custom Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    19.4 Empirical Cost Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.5 Implementation Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.5.1 Stack Traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.5.2 Symbolization of Instruction Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.5.3 Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.5.4 Using the Standard Library in the Instrumentation Implementation . . . . . . . . . . . . . . . . . . . . . 118

    19.5.5 Malloc Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.5.6 Construction and Destruction of Global Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    19.6 Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    19.6.1 Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    19.6.2 How To Add A Diagnostic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    19.7 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

    19.7.1 Diagnostic Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

    19.7.2 Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

    19.7.2.1 Hashtable Too Small . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

    19.7.2.2 Hashtable Too Large . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

    19.7.2.3 Inefficient Hash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

    19.7.2.4 Vector Too Small . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

    19.7.2.5 Vector Too Large . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

    19.7.2.6 Vector to Hashtable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

    19.7.2.7 Hashtable to Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

    19.7.2.8 Vector to List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

    19.7.2.9 List to Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

    19.7.2.10 List to Forward List (Slist) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

    19.7.2.11 Ordered to Unordered Associative Container . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    19.7.3 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    19.7.3.1 Sort Algorithm Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    19.7.4 Data Locality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    19.7.4.1 Need Software Prefetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

    19.7.4.2 Linked Structure Locality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

    19.7.5 Multithreaded Data Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

    19.7.5.1 Data Dependence Violations at Container Level . . . . . . . . . . . . . . . . . . . . . . . . . 128

    19.7.5.2 False Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

    19.7.6 Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

    19.8 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

  • The GNU C++ Library Manualxii

    20 Allocators 130

    20.1 mt_allocator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

    20.1.1 Intro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

    20.1.2 Design Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

    20.1.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

    20.1.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

    20.1.3.1 Tunable Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

    20.1.3.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    20.1.3.3 Deallocation Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    20.1.4 Single Thread Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

    20.1.5 Multiple Thread Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

    20.2 bitmap_allocator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

    20.2.1 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

    20.2.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

    20.2.2.1 Free List Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

    20.2.2.2 Super Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

    20.2.2.3 Super Block Data Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

    20.2.2.4 Maximum Wasted Percentage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

    20.2.2.5 allocate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

    20.2.2.6 deallocate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

    20.2.2.7 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

    20.2.2.7.1 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

    20.2.2.7.2 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

    20.2.2.7.3 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

    20.2.2.8 Locality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

    20.2.2.9 Overhead and Grow Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

    21 Containers 140

    21.1 Policy Based Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

    21.2 HP/SGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

    21.3 Deprecated HP/SGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    22 Utilities 142

    23 Algorithms 143

    24 Numerics 144

    25 Iterators 145

    26 Input and Output 146

    26.1 Derived filebufs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

  • The GNU C++ Library Manualxiii

    27 Demangling 147

    28 Concurrency 149

    28.1 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

    28.1.1 Interface to Locks and Mutexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

    28.1.2 Interface to Atomic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

    28.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

    28.2.1 Using Builtin Atomic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

    28.2.2 Thread Abstraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

    28.3 Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

    IV Appendices 153

    A Contributing 154

    A.1 Contributor Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    A.1.1 Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    A.1.2 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    A.1.3 Getting Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

    A.1.4 Submitting Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

    A.2 Directory Layout and Source Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

    A.3 Coding Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

    A.3.1 Bad Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

    A.3.2 By Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

    A.4 Documentation Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

    A.4.1 Doxygen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

    A.4.1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

    A.4.1.2 Generating the Doxygen Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

    A.4.1.3 Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

    A.4.2 Docbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

    A.4.2.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

    A.4.2.2 Generating the DocBook Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

    A.4.2.3 File Organization and Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

    A.4.2.4 Markup By Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

    A.4.3 Combines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

    A.4.3.1 Generating Combines and Assemblages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

    A.5 Design Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

  • The GNU C++ Library Manualxiv

    B Porting and Maintenance 188

    B.1 Configure and Build Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

    B.1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

    B.1.2 Overview: What Comes from Where . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

    B.1.3 Storing Information in non-AC files (like configure.host) . . . . . . . . . . . . . . . . . . . . . . . . . . 188

    B.1.4 Coding and Commenting Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

    B.1.5 The acinclude.m4 layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

    B.1.6 GLIBCXX_ENABLE, the --enable maker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

    B.2 Porting to New Hardware or Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

    B.2.1 Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

    B.2.2 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192

    B.2.3 Character Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192

    B.2.4 Thread Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

    B.2.5 Numeric Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

    B.2.6 Libtool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

    B.3 Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

    B.3.1 Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

    B.3.1.1 Directory Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

    B.3.1.2 Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

    B.3.2 Running the Testsuite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

    B.3.2.1 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

    B.3.2.2 Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

    B.3.2.3 Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

    B.3.3 Writing a new test case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

    B.3.4 Test Harness and Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

    B.3.4.1 Dejagnu Harness Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

    B.3.4.2 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

    B.3.5 Special Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

    B.3.5.1 Qualifying Exception Safety Guarantees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

    B.3.5.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

    B.3.5.1.2 Existing tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

    B.3.5.1.3 C++0x Requirements Test Sequence Descriptions . . . . . . . . . . . . . . . . . . 204

    B.4 ABI Policy and Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

    B.4.1 The C++ Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

    B.4.2 Versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

    B.4.2.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

    B.4.2.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

    B.4.2.3 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

    B.4.2.4 Configuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

  • The GNU C++ Library Manualxv

    B.4.2.5 Checking Active . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

    B.4.3 Allowed Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

    B.4.4 Prohibited Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214

    B.4.5 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214

    B.4.6 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

    B.4.6.1 Single ABI Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

    B.4.6.2 Multiple ABI Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

    B.4.7 Outstanding Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

    B.4.8 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

    B.5 API Evolution and Deprecation History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

    B.5.1 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

    B.5.2 3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

    B.5.3 3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

    B.5.4 3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

    B.5.5 3.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

    B.5.6 4.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

    B.5.7 4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

    B.5.8 4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

    B.5.9 4.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

    B.5.10 4.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

    B.5.11 4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

    B.6 Backwards Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    B.6.1 First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    B.6.1.1 No ios_base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    B.6.1.2 No cout in ostream.h, no cin in istream.h . . . . . . . . . . . . . . . . . . . . . . . 222

    B.6.2 Second . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    B.6.2.1 Namespace std:: not supported . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    B.6.2.2 Illegal iterator usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

    B.6.2.3 isspace from cctype is a macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

    B.6.2.4 No vector::at, deque::at, string::at . . . . . . . . . . . . . . . . . . . . . . . . 224

    B.6.2.5 No std::char_traits::eof . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

    B.6.2.6 No string::clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

    B.6.2.7 Removal of ostream::form and istream::scan extensions . . . . . . . . . . . . . . 225

    B.6.2.8 No basic_stringbuf, basic_stringstream . . . . . . . . . . . . . . . . . . . . . . 225

    B.6.2.9 Little or no wide character support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

    B.6.2.10 No templatized iostreams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

    B.6.2.11 Thread safety issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

    B.6.3 Third . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

    B.6.3.1 Pre-ISO headers moved to backwards or removed . . . . . . . . . . . . . . . . . . . . . . . . 227

  • The GNU C++ Library Manualxvi

    B.6.3.2 Extension headers hash_map, hash_set moved to ext or backwards . . . . . . . . . . . . . . . 228

    B.6.3.3 No ios::nocreate/ios::noreplace. . . . . . . . . . . . . . . . . . . . . . . . . . . 229

    B.6.3.4 No stream::attach(int fd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

    B.6.3.5 Support for C++98 dialect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

    B.6.3.6 Support for C++TR1 dialect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

    B.6.3.7 Support for C++0x dialect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

    B.6.3.8 Container::iterator_type is not necessarily Container::value_type* . . . . . . . . . . . . . . . 236

    B.6.4 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

    C Free Software Needs Free Documentation 237

    D GNU General Public License version 3 239

    E GNU Free Documentation License 248

    29 Index 254

  • The GNU C++ Library Manualxvii

    List of Tables

    1.1 C++ 1998/2003 Implementation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.2 C++ 200x Implementation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    1.3 C++ TR1 Implementation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    1.4 C++ TR 24733 Implementation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    3.1 C++ Command Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    3.2 C++ 1998 Library Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.3 C++ 1998 Library Headers for C Library Facilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.4 C++ 200x Library Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.5 C++ 200x Library Headers for C Library Facilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.6 C++ TR 1 Library Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.7 C++ TR 1 Library Headers for C Library Facilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.8 C++ TR 24733 Decimal Floating-Point Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    3.9 C++ ABI Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    3.10 Extension Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    3.11 Extension Debug Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    3.12 Extension Profile Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    3.13 Extension Parallel Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    17.1 Debugging Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    17.2 Debugging Containers C++0x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    18.1 Parallel Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    19.1 Profile Code Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    19.2 Profile Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

    20.1 Bitmap Allocator Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

    A.1 HTML to Doxygen Markup Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

    A.2 HTML to Docbook XML Markup Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

    A.3 Docbook XML Element Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

    B.1 Extension Allocators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

    B.2 Extension Allocators Continued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

  • The GNU C++ Library Manual1 / 254

    Part I

    Introduction

  • The GNU C++ Library Manual2 / 254

    Chapter 1

    Status

    1.1 Implementation Status

    1.1.1 C++ 1998/2003

    1.1.1.1 Implementation Status

    This status table is based on the table of contents of ISO/IEC 14882:2003.

    This page describes the C++ support in mainline GCC SVN, not in any particular release.

    1.1.1.2 Implementation Specific Behavior

    The ISO standard defines the following phrase:

    [1.3.5] implementation-defined behavior Behavior, for a well-formed program construct and cor-rect data, that depends on the implementation and that each implementation shall document.

    We do so here, for the C++ library only. Behavior of the compiler, linker, runtime loader, and other elements of "the implemen-tation" are documented elsewhere. Everything listed in Annex B, Implementation Qualities, are also part of the compiler, not thelibrary.

    For each entry, we give the section number of the standard, when applicable. This list is probably incomplet and inkorrekt.

    [1.9]/11 #3 If isatty(3) is true, then interactive stream support is implied.

    [17.4.4.5] Non-reentrant functions are probably best discussed in the various sections on multithreading (see above).

    [18.1]/4 The type of NULL is described here.

    [18.3]/8 Even though its listed in the library sections, libstdc++ has zero control over what the cleanup code hands back to theruntime loader. Talk to the compiler people. :-)

    [18.4.2.1]/5 (bad_alloc), [18.5.2]/5 (bad_cast), [18.5.3]/5 (bad_typeid), [18.6.1]/8 (exception), [18.6.2.1]/5 (bad_exception):The what() member function of class std::exception, and these other classes publicly derived from it, simply returnsthe name of the class. But they are the mangled names; you will need to call c++filt and pass the names as command-lineparameters to demangle them, or call a runtime demangler function. (The classes in have constructors whichrequire an argument to use later for what() calls, so the problem of what()s value does not arise in most user-definedexceptions.)

    [18.5.1]/7 The return value of std::type_info::name() is the mangled type name (see the previous entry for more).

  • The GNU C++ Library Manual3 / 254

    Section Description Status Comments18 Language support18.1 Types Y18.2 Implementation properties Y18.2.1 Numeric Limits

    18.2.1.1 Class templatenumeric_limits

    Y

    18.2.1.2 numeric_limitsmembers Y

    18.2.1.3 float_round_style Y18.2.1.4 float_denorm_style Y

    18.2.1.5 numeric_limitsspecializations Y

    18.2.2 C Library Y18.3 Start and termination Y

    18.4 Dynamic memorymanagement Y

    18.5 Type identification18.5.1 Class type_info Y18.5.2 Class bad_cast Y18.5.3 Class bad_typeid Y18.6 Exception handling18.6.1 Class exception Y

    18.6.2 Violationexception-specifications Y

    18.6.3 Abnormal termination Y18.6.4 uncaught_exception Y18.7 Other runtime support Y19 Diagnostics19.1 Exception classes Y19.2 Assertions Y19.3 Error numbers Y20 General utilities20.1 Requirements Y20.2 Utility components20.2.1 Operators Y20.2.2 pair Y20.3 Function objects20.3.1 Base Y20.3.2 Arithmetic operation Y20.3.3 Comparisons Y20.3.4 Logical operations Y20.3.5 Negators Y20.3.6 Binders Y

    20.3.7 Adaptors for pointers tofunctions Y

    20.3.8 Adaptors for pointers tomembers Y

    20.4 Memory20.4.1 The default allocator Y20.4.2 Raw storage iterator Y20.4.3 Temporary buffers Y20.4.4 Specialized algorithms Y20.4.4.1 uninitialized_copy Y20.4.4.2 uninitialized_fill Y

    20.4.4.3 uninitialized_fil-l_n

    Y

    20.4.5 Class template auto_ptr Y20.4.6 C library Y21 Strings21.1 Character traits

    21.1.1 Character traitsrequirements Y

    21.1.2 traits typedef Y

    21.1.3 char_traitsspecializations

    21.1.3.1 structchar_traits

    Y

    21.1.3.2 struct char_traits

    Y

    21.2 String classes Y

    21.3 Class templatebasic_string

    Y

    21.4 Null-terminated sequenceutilities Y C library dependency

    22 Localization22.1 Locales22.1.1 Class locale Y22.1.2 locale globals Y22.1.3 Convenience interfaces22.1.3.1 Character classification Y22.1.3.2 Character conversions Y22.2 Standard locale categories22.2.1 ctype Y22.2.2 Numeric22.2.2.1 num_get Y22.2.2.2 num_put Y22.2.3 num_punct Y22.2.4 collate Y22.2.5 Time22.2.5.1 time_get Y22.2.5.2 time_get_byname Y22.2.5.3 time_put Y22.2.5.3 time_put_byname Y22.2.6 Monetary22.2.6.1 money_get Y22.2.6.2 money_put Y22.2.6.3 money_punct Y22.2.6.4 money_punct_byname Y22.2.7 messages Y22.2.8 Program-defined facets Y22.3 C Library Locales Y23 Containers23.1 Container requirements Y23.2 Sequence containers23.2.1 Class template deque Y23.2.2 Class template list Y23.2.3 Adaptors23.2.3.1 Class template queue Y

    23.2.3.2 Class templatepriority_queue

    Y

    23.2.3.3 Class template stack Y23.2.4 Class template vector Y23.2.5 Class vector Y23.3 Associative containers23.3.1 Class template map Y23.3.2 Class template multimap Y23.3.3 Class template set Y23.3.4 Class template multiset Y24 Iterators24.1 Requirements Y

    24.2 Header synopsis Y

    24.3 Iterator primitives Y

    24.4 Predefined iterators andIterator adaptors24.4.1 Reverse iterators Y24.4.2 Insert iterators Y24.5 Stream iterators

    24.5.1 Class templateistream_iterator

    Y

    24.5.2 Class templateostream_iterator

    Y

    24.5.3 Class template istream-buf_iterator

    Y

    24.5.4 Class template ostream-buf_iterator

    Y

    25 Algorithms

    25.1 Non-modifying sequenceoperations Y

    25.2 Mutating sequenceoperations Y

    25.3 Sorting and relatedoperations Y

    25.4 C library algorithms Y26 Numerics26.1 Numeric type requirements Y26.2 Complex numbers Y26.3 Numeric arrays

    26.3.1 Header synopsis Y

    26.3.2 Class template valarray Y

    26.3.3 valarray non-memberoperations Y

    26.3.4 Class slice Y

    26.3.5 Class templateslice_array

    Y

    26.3.6 Class gslice Y

    26.3.7 Class templategslice_array

    Y

    26.3.8 Class templatemask_array

    Y

    26.3.9 Class templateindirect_array

    Y

    26.4 Generalized numericoperations26.4.1 accumulate Y26.4.2 inner_product Y26.4.3 partial_sum Y

    26.4.4 adjacent_differen-ce

    Y

    26.4.5 iota Y26.5 C Library Y27 Input/output27.1 Requirements Y27.2 Forward declarations Y27.3 Standard iostream objects Y27.3.1 Narrow stream objects Y27.3.2 Wide stream objects Y27.4 Iostreams base classes Y27.5 Stream buffers Y

    27.6 Formatting andmanipulators Y

    27.7 String-based streams Y27.8 File-based streams YAppendix D Compatibility features

    D.1 Increment operator withbool operandD.2 static keywordD.3 Access declarations

    D.4 Implicit conversion fromconst stringsD.5 C standard library headersD.6 Old iostreams membersD.7 char* streams

    Table 1.1: C++ 1998/2003 Implementation Status

  • The GNU C++ Library Manual4 / 254

    [20.1.5]/5 "Implementors are encouraged to supply libraries that can accept allocators that encapsulate more general memorymodels and that support non-equal instances. In such implementations, any requirements imposed on allocators by containersbeyond those requirements that appear in Table 32, and the semantics of containers and algorithms when allocator instancescompare non-equal, are implementation-defined." As yet we dont have any allocators which compare non-equal, so we cantdescribe how they behave.

    [21.1.3.1]/3,4, [21.1.3.2]/2, [23.*]s foo::iterator, [27.*]s foo::*_type, others... Nope, these types are called implementation-defined because you shouldnt be taking advantage of their underlying types. Listing them here would defeat the purpose. :-)

    [21.1.3.1]/5 I dont really know about the mbstate_t stuff... see the chapter 22 notes for what does exist.

    [22.*] Anything and everything we have on locale implementation will be described over here.

    [26.2.8]/9 I have no idea what complexs pow(0,0) returns.

    [27.4.2.4]/2 Calling std::ios_base::sync_with_stdio after I/O has already been performed on the standard streamobjects will flush the buffers, and destroy and recreate the underlying buffer instances. Whether or not the previously-written I/Ois destroyed in this process depends mostly on the --enable-libio choice: for stdio, if the written data is already in the stdio buffer,the data may be completely safe!

    [27.6.1.1.2], [27.6.2.3] The I/O sentry ctor and dtor can perform additional work than the minimum required. We are notcurrently taking advantage of this yet.

    [27.7.1.3]/16, [27.8.1.4]/10 The effects of pubsetbuf/setbuf are described in this chapter.

    [27.8.1.4]/16 Calling fstream::sync when a get area exists will... whatever fflush() does, I think.

    1.1.2 C++ 200x

    This table is based on the table of contents of ISO/IEC JTC1 SC22 WG21 Doc No: N3092 Date: 2010-03-26 Final CommitteeDraft, Standard for Programming Language C++

    In this implementation -std=gnu++0x or -std=c++0x flags must be used to enable language and library features. Seedialect options. The pre-defined symbol __GXX_EXPERIMENTAL_CXX0X__ is used to check for the presence of the requiredflag.

    This page describes the C++0x support in mainline GCC SVN, not in any particular release.

    1.1.3 C++ TR1

    This table is based on the table of contents of ISO/IEC DTR 19768 Doc No: N1836=05-0096 Date: 2005-06-24 Draft TechnicalReport on C++ Library Extensions

    In this implementation the header names are prefixed by tr1/, for instance , , and soon.

    This page describes the TR1 support in mainline GCC SVN, not in any particular release.

    1.1.4 C++ TR 24733

    This table is based on the table of contents of ISO/IEC TR 24733 Date: 2009-08-28 Extension for the programming languageC++ to support decimal floating-point arithmetic

    This page describes the TR 24733 support in mainline GCC SVN, not in any particular release.

    1.2 License

    There are two licenses affecting GNU libstdc++: one for the code, and one for the documentation.

    There is a license section in the FAQ regarding common questions. If you have more questions, ask the FSF or the gcc mailinglist.

  • The GNU C++ Library Manual5 / 254

    Section Description Status Comments18 Language support18.1 General Y

    18.2 Types Partial Missing offsetof,max_align_t18.3 Implementation properties18.3.1 Numeric Limits

    18.3.1.1 Class templatenumeric_limits

    Y

    18.3.1.2 numeric_limitsmembers Partial Missing constexpr

    18.3.1.3 float_round_style N18.3.1.4 float_denorm_style N

    18.3.1.5 numeric_limitsspecializations Y

    18.3.2 C Library Y18.4 Integer types

    18.4.1 Header synopsis Y

    18.5 Start and termination Partial C library dependency forquick_exit, at_quick_exit

    18.6 Dynamic memorymanagement Y

    18.7 Type identification18.7.1 Class type_info Y18.7.2 Class bad_cast Y18.7.3 Class bad_typeid Y18.8 Exception handling18.8.1 Class exception Y

    18.8.2 Violatingexception-specifications Y

    18.8.3 Abnormal termination Y18.8.4 uncaught_exception Y18.8.5 Exception Propagation Y18.8.6 nested_exception Y18.9 Initializer lists18.9.1 Initializer list constructors Y18.9.2 Initializer list access Y18.9.3 Initializer list range access N18.10 Other runtime support Y19 Diagnostics19.1 General Y19.2 Exception classes Y19.3 Assertions Y19.4 Error numbers Y19.5 System error support19.5.1 Class error_category Y19.5.2 Class error_code Y

    19.5.3 Classerror_condition

    Y

    19.5.4 Comparison operators Y19.5.5 Class system_error Y20 General utilities20.1 General20.2 Requirements20.3 Utility components20.3.1 Operators Y20.3.2 Swap Y

    20.3.3 forward and movehelpers Y

    20.3.4 Function templatedeclval

    Y

    20.3.5 Pairs20.3.5.1 In general20.3.5.2 Class template pair Partial Missing constexpr20.3.5.3 Tuple-like access to pair Y20.3.5.4 pair range access N20.3.5.5 Piecewise construction N20.4 Tuples20.4.1 In general

    20.4.2 Class template tuple Partial Missing constexpr andrange access20.5 Class template bitset Partial Missing constexpr

    20.6 Compile-time rationalarithmetic20.6.1 Class template ratio Y20.6.2 Arithmetic on ratio types Y

    20.6.3 Comparison of ratiotypes Y

    20.6.4 SI types for ratio Y

    20.7 Metaprogramming and typetraits20.7.1 Requirements Y

    20.7.2 Header synopsis20.7.3 Helper classes Y20.7.4 Unary Type Traits Y20.7.4.1 Primary type categories Y20.7.4.2 Composite type traits Y

    20.7.4.3 Type properties Partial

    Missingis_trivially_copyable,is_literal_type,is_nothrow_constructible

    20.7.5 Relationships betweentypes Y

    20.7.6 Transformations betweentypes Partial Missing underlying_type

    20.7.6.1 Const-volatile modifications Y20.7.6.2 Reference modifications Y20.7.6.3 Sign modifications Y20.7.6.4 Array modifications Y20.7.6.5 Pointer modifications Y20.7.6.6 Other transformations Y20.8 Function objects20.8.1 Definitions Y20.8.2 Requirements Y20.8.3 Base Y

    20.8.4 Class templatereference_wrapper

    Y

    20.8.5 Arithmetic operation Y20.8.6 Comparisons Y20.8.7 Logical operations Y20.8.8 Bitwise operations Y20.8.9 Negators Y20.8.10 Function template bind Y

    20.8.11 Adaptors for pointers tofunctions Y

    20.8.12 Adaptors for pointers tomembers Y

    20.8.13 Function template mem_fn Y

    20.8.14 Polymorphic functionwrappers

    20.8.14.1 Classbad_function_call

    Y

    20.8.14.2 Class template function Y20.8.15 Class template hash Y20.9 Memory20.9.1 Allocator argument tag N20.9.2 uses_allocator N20.9.3 Pointer traits N20.9.4 Allocator traits N20.9.5 The default allocator Y20.9.6 Scoped allocator adaptor

    20.9.6.1 Scoped allocator adaptormember types N

    20.9.6.2 Scoped allocator adaptorconstructors N

    20.9.6.3 Scoped allocator adaptormembers N

    20.9.7 Raw storage iterator Y20.9.8 Temporary buffers Y20.9.9 Specialized algorithms20.9.9.1 addressof N20.9.9.2 uninitialized_copy Y20.9.9.3 uninitialized_fill Y

    20.9.9.4 uninitialized_fil-l_n

    Y

    20.9.10 Class templateunique_ptr

    Y

    20.9.11 Smart pointers20.9.11.1 Class bad_weak_ptr Y

    20.9.11.2 Class templateshared_ptr

    YUses code fromboost::shared_ptr.

    20.9.11.3 Class template weak_ptr Y

    20.9.11.4 Class template emable_-shared_from_this

    Y

    20.9.11.5 shared_ptr atomicaccess Partial

    20.9.11.6 Hash support Y20.9.12 Pointer safety Partial20.9.13 Align N20.9.16 C library Y20.10 Time utilities20.10.1 Clock requirements Y20.10.2 Time-related traits

    20.10.2.1 treat_as_floating-_point

    Y

    20.10.2.2 duration_values Partial Missing constexpr

    20.10.2.3 Specializations ofcommon_type

    Y

    20.10.3 Class template duration Partial Missing constexpr

    20.10.4 Class templatetime_point

    Partial Missing constexpr

    20.10.5 Clocks20.10.5.1 Class system_clock Y

    20.10.5.2 Classmonotonic_clock

    Y

    20.10.5.3 Class high_resoluti-on_clock

    Y

    20.11 Date and time functions Y20.12 Class type_index N21 Strings21.1 General Y21.2 Character traits

    21.2.1 Character traitsrequirements Y

    21.2.2 traits typedefs Y

    21.2.3 char_traitsspecializations

    21.2.3.1 structchar_traits

    Partial Missing constexpr

    21.2.3.2 struct char_traits

    Partial Missing constexpr

    21.2.3.3 struct char_traits

    Partial Missing constexpr

    21.2.3.4 struct char_traits

    Partial Missing constexpr

    21.3 String classes Y

    21.4 Class templatebasic_string

    Y

    21.5 Numeric Conversions Y21.6 Hash support Y

    21.7 Null-terminated sequenceutilities Y C library dependency

    22 Localization22.1 General Y

    22.2 Header synopsis Y

    22.3 Locales22.3.1 Class locale Y22.3.2 locale globals Y22.3.3 Convenience interfaces22.3.3.1 Character classification Y22.3.3.2 Conversions22.3.3.2.1 Character conversions Y22.3.3.2.2 string conversions N22.3.3.2.3 Buffer conversions N

    22.4 Standard localecategories22.4.1 The ctype category Y22.4.2 The numeric category22.4.2.1 num_get Y22.4.2.2 num_put Y

    22.4.3 The numeric punctuationfacet Y

    22.4.4 The collate category Y22.4.5 The time category22.4.5.1 Class template time_get Y

    22.4.5.2 Class templatetime_get_byname

    Y

    22.4.5.3 Class template time_put Y

    22.4.5.3 Class templatetime_put_byname

    Y

    22.4.6 The monetary category

    22.4.6.1 Class templatemoney_get

    Y

    22.4.6.2 Class templatemoney_put

    Y

    22.4.6.3 Class templatemoney_punct

    Y

    22.4.6.4 Class templatemoney_punct_byname

    Y

    22.4.7 The message retrievalcategory Y

    22.4.8 Program-defined facets Y

    22.5 Standard code conversionfacets N

    22.6 C Library Locales Y23 Containers23.1 General23.2 Container requirements

    23.2.1 General containerrequirements Y

    23.2.2 Data races Y23.2.3 Sequence containers Y23.2.4 Associative containers Y

    23.2.5 Unordered associativecontainers Y

    23.3 Sequence containers23.3.1 Class template array Partial Missing constexpr23.3.2 Class template deque Y

    23.3.3 Class templateforward_list

    Y

    23.3.4 Class template list Y23.3.5 Container adaptors23.3.5.1 Class template queue Y

    23.3.5.2 Class templatepriority_queue

    Y

    23.3.5.3 Class template stack Y23.3.6 Class template vector Y23.3.7 Class vector Y23.4 Associative containers23.4.1 Class template map Y23.4.2 Class template multimap Y23.4.3 Class template set Y23.4.4 Class template multiset Y

    23.5 Unordered associativecontainers

    23.5.1 Class templateunordered_map

    Y

    23.5.2 Class templateunordered_multimap

    Y

    23.5.3 Class templateunordered_set

    Y

    23.5.4 Class templateunordered_multiset

    Y

    24 Iterators24.1 General Y24.2 Iterator requirements Y

    24.3 Header synopsis Y

    24.4 Iterator primitives Y24.5 Iterator adaptors24.5.1 Reverse iterators Y24.5.2 Insert iterators Y24.5.3 Move iterators Y24.6 Stream iterators

    24.6.1 Class templateistream_iterator

    Y

    24.6.2 Class templateostream_iterator

    Y

    24.6.3 Class template istream-buf_iterator

    Y

    24.6.4 Class template ostream-buf_iterator

    Y

    24.6.5 range access N25 Algorithms25.1 General

    25.2 Non-modifying sequenceoperations Y

    25.3 Mutating sequenceoperations Y

    25.4 Sorting and relatedoperations Y

    25.5 C library algorithms Y26 Numerics26.1 General Y26.2 Numeric type requirements Y

    26.3 The floating-pointenvironment Y

    26.4 Complex numbers Partial Missing constexpr26.5 Random number generation26.5.1 Requirements

    26.5.2 Header synopsis

    26.5.3 Random number engineclass templates

    26.5.3.1Class templatelinear_congruenti-al_engine

    Y Missing constexpr

    26.5.3.2 Class template mersenn-e_twister_engine

    Y Missing constexpr

    26.5.3.3Class templatesubtract_with_car-ry_engine

    Y Missing constexpr

    26.5.4 Random number engineadaptor class templates

    26.5.4.1 Class template discard-_block_engine

    Y Missing constexpr

    26.5.4.2 Class template indepen-dent_bits_engine

    Y Missing constexpr

    26.5.4.3 Class template shuffle-_order_engine

    Y Missing constexpr

    26.5.5Engines and engineadaptors with predefinedparameters

    Y

    26.5.6 Class random_device Y Missing constexpr26.5.7 Utilities26.5.7.1 Class seed_seq Y

    26.5.7.2 Function templategenerate_canonical

    Y

    26.5.8 Random numberdistribution class templates26.5.8.1 Uniform distributions

    26.5.8.1.1 Class template uniform-_int_distribution

    Y

    26.5.8.1.2 Class template uniform-_real_distribution

    Y

    26.5.8.2 Bernoulli distributions

    26.5.8.2.1 Class bernoulli_dis-tribution

    Y

    26.5.8.2.2 Class template binomia-l_distribution

    Y

    26.5.8.2.3 Class template geometr-ic_distribution

    Y

    26.5.8.2.4Class templatenegative_binomial-_distribution

    Y

    26.5.8.3 Poisson distributions

    26.5.8.3.1 Class template poisson-_distribution

    Y

    26.5.8.3.2 Class template exponen-tial_distribution

    Y

    26.5.8.3.3 Class templategamma_distribution

    Y

    26.5.8.3.4 Class template weibull-_distribution

    Y

    26.5.8.3.5Class templateextreme_value_dis-tribution

    Y

    26.5.8.4 Normal distributions

    26.5.8.4.1 Class template normal_-distribution

    Y

    26.5.8.4.2 Class template lognorm-al_distribution

    Y

    26.5.8.4.3 Class template chi_squ-ared_distribution

    Y

    26.5.8.4.4 Class template cauchy_-distribution

    Y

    26.5.8.4.5 Class template fisher_-f_distribution

    Y

    26.5.8.4.6 Class template student-_t_distribution

    Y

    26.5.8.5 Sampling distributions

    26.5.8.5.1 Class template discret-e_distribution

    Y

    26.5.8.5.2Class templatepiecewise_constan-t_distribution

    Y

    26.5.8.5.3Class templatepiecewise_linear_-distribution

    Y

    26.6 Numeric arrays

    26.6.1 Header synopsis Y

    26.6.2 Class template valarray Y

    26.6.3 valarray non-memberoperations Y

    26.6.4 Class slice Y

    26.6.5 Class templateslice_array

    Y

    26.6.6 The gslice class Y

    26.6.7 Class templategslice_array

    Y

    26.6.8 Class templatemask_array

    Y

    26.6.9 Class templateindirect_array

    Y

    26.6.10 valarray range access N

    26.7 Generalized numericoperations26.7.1 accumulate Y26.7.2 inner_product Y26.7.3 partial_sum Y

    26.7.4 adjacent_differen-ce

    Y

    26.7.5 iota Y26.8 C Library Y27 Input/output library27.1 General Y27.2 Iostreams requirements Y27.2.1 Imbue Limitations Y

    27.2.2 Positioning TypeLimitations Y

    27.2.3 Thread safety Partial27.3 Forward declarations Y27.4 Standard iostream objects Y27.4.1 Narrow stream objects Y27.4.2 Wide stream objects Y

    27.5 Iostreams base classes Partial Missing move and swapoperations27.6 Stream buffers Y

    27.7 Formatting andmanipulators PartialMissing move and swapoperations

    27.8 String-based streams Partial Missing move and swapoperations

    27.9 File-based streams Partial Missing move and swapoperations28 Regular expressions28.1 General N28.2 Definitions N28.3 Requirements N28.4 Header synopsis N

    28.5 Namespace std::rege-x_constants

    Y

    28.6 Class regex_error Y

    28.7 Class templateregex_traits

    Partial

    28.8 Class templatebasic_regex

    Partial

    28.9 Class templatesub_match

    Partial

    28.10 Class templatematch_results

    Partial

    28.11 Regular expressionalgorithms N

    28.12 Regular expression Iterators N

    28.13 Modified ECMAScriptregular expression grammar N

    29 Atomic operations29.1 General Y

    29.2 Header synopsis Y

    29.3 Order and consistency N

    29.4 Lock-free property Y Based on_GLIBCXX_ATOMIC_PROPERTY29.5 Atomic types29.5.1 Integral types Y Missing constexpr29.5.2 Address types Y Missing constexpr29.5.3 Generic types Y Missing constexpr29.6 Operations on atomic types Y29.7 Flag Type and operations Y29.8 Fences N30 Thread support30.1 General Y30.2 Requirements Y30.3 Threads

    30.3.1 Class thread Partial thread::id is nottrivially copyable

    30.3.2 Namespacethis_thread

    Y

    30.4 Mutual exclusion30.4.1 Mutex requirements30.4.1.1 Class mutex Y Missing constexpr

    30.4.1.2 Classrecursive_mutex

    Y

    30.4.2 Timed mutex requirements30.4.2.1 Class timed_mutex Y

    30.4.2.2 Class recursive_tim-ed_mutex

    Y

    30.4.3 Locks

    30.4.3.1 Class templatelock_guard

    Y

    30.4.3.2 Class templateunique_lock

    Y

    30.4.4 Generic locking algorithms Y30.4.5 Call once30.4.5.1 once_flag Y Missing constexpr30.4.5.2 call_once Y

    30.5 Condition variables Partial Missingnotify_all_at_thread_exit

    30.5.1 Classcondition_variable

    Y

    30.5.2 Class condition_var-iable_any

    Y

    30.6 Futures30.6.1 Overview30.6.2 Error handling Y Missing constexpr30.6.3 Class future_error Y

    30.6.4 Associated asynchronousstate Y

    30.6.5 Class template promise PartialMissingallocator_arg_t andset_*_at_thread_exit

    30.6.6 Class template future Partial Missing future_status

    30.6.7 Class templateshared_future

    Partial Missing future_status

    30.6.8 Class templateatomic_future

    N

    30.6.9 Function template async Y

    30.6.10 Class templatepackaged_task

    PartialMissingallocator_arg_t andmake_ready_at_thread_exit

    Appendix D Compatibility features

    D.1 Increment operator withbool operand

    D.2 static keywordD.3 Access declarationsD.4 register keyword

    D.5 Dynamic exceptionspecificationsD.6 C standard library headersD.7 Old iostreams membersD.8 char* streamsD.9 BindersD.10 auto_ptr

    Table 1.2: C++ 200x Implementation Status

  • The GNU C++ Library Manual6 / 254

    Section Description Status Comments2 General Utilities2.1 Reference wrappers

    2.1.1 Additions to header synopsis Y

    2.1.2 Class templatereference_wrapper

    2.1.2.1 reference_wrapperconstruct/copy/destroy Y

    2.1.2.2 reference_wrapperassignment Y

    2.1.2.3 reference_wrapperaccess Y

    2.1.2.4 reference_wrapperinvocation Y

    2.1.2.5 reference_wrapperhelper functions Y

    2.2 Smart pointers

    2.2.1 Additions to header synopsis Y

    2.2.2 Class bad_weak_ptr Y

    2.2.3 Class templateshared_ptr

    Uses code fromboost::shared_ptr.

    2.2.3.1 shared_ptr constructors Y2.2.3.2 shared_ptr destructor Y2.2.3.3 shared_ptr assignment Y2.2.3.4 shared_ptr modifiers Y2.2.3.5 shared_ptr observers Y2.2.3.6 shared_ptr comparison Y2.2.3.7 shared_ptr I/O Y

    2.2.3.8 shared_ptr specializedalgorithms Y

    2.2.3.9 shared_ptr casts Y2.2.3.10 get_deleter Y2.2.4 Class template weak_ptr2.2.4.1 weak_ptr constructors Y2.2.4.2 weak_ptr destructor Y2.2.4.3 weak_ptr assignment Y2.2.4.4 weak_ptr modifiers Y2.2.4.5 weak_ptr observers Y2.2.4.6 weak_ptr comparison Y

    2.2.4.7 weak_ptr specializedalgorithms Y

    2.2.5 Class template enable_-shared_from_this

    Y

    3 Function Objects3.1 Definitions Y

    3.2Additions to

    synopsis

    Y

    3.3 Requirements Y3.4 Function return types Y3.5 Function template mem_fn Y3.6 Function object binders

    3.6.1 Class templateis_bind_expression

    Y

    3.6.2 Class templateis_placeholder

    Y

    3.6.3 Function template bind Y3.6.4 Placeholders Y

    3.7 Polymorphic functionwrappers

    3.7.1 Classbad_function_call

    Y

    3.7.1.1 bad_function_callconstructor Y

    3.7.2 Class template function

    3.7.2.1 functionconstruct/copy/destroy Y

    3.7.2.2 function modifiers Y3.7.2.3 function capacity Y3.7.2.4 function invocation Y3.7.2.5 function target access Y3.7.2.6 undefined operators Y

    3.7.2.7 null pointer comparisonoperators Y

    3.7.2.8 specialized algorithms Y4 Metaprogramming and type traits4.1 Requirements Y

    4.2 Header synopsis Y

    4.3 Helper classes Y4.4 General Requirements Y4.5 Unary Type Traits4.5.1 Primary Type Categories Y4.5.2 Composite type traits Y4.5.3 Type properties Y

    4.6 Relationships betweentypes Y

    4.7 Transformations betweentypes4.7.1 Const-volatile modifications Y4.7.2 Reference modifications Y4.7.3 Array modifications Y4.7.4 Pointer modifications Y4.8 Other transformations Y

    4.9 Implementationrequirements Y

    5 Numerical Facilities5.1 Random number generation5.1.1 Requirements Y

    5.1.2 Header synopsis Y

    5.1.3 Class templatevariate_generator

    Y

    5.1.4 Random number engineclass templates Y

    5.1.4.1 Class template linear_-congruential

    Y

    5.1.4.2 Class templatemersenne_twister

    Y

    5.1.4.3 Class template subtrac-t_with_carry

    Y

    5.1.4.4 Class template subtrac-t_with_carry_01

    Y

    5.1.4.5 Class templatediscard_block

    Y

    5.1.4.6 Class templatexor_combine

    Y operator()() per N2079

    5.1.5 Engines with predefinedparameters Y

    5.1.6 Class random_device Y

    5.1.7 Random distribution classtemplates Y

    5.1.7.1 Class templateuniform_int

    Y

    5.1.7.2 Class bernoulli_dis-tribution

    Y

    5.1.7.3 Class template geometr-ic_distribution

    Y

    5.1.7.4 Class template poisson-_distribution

    Y

    5.1.7.5 Class template binomia-l_distribution

    Y

    5.1.7.6 Class templateuniform_real

    Y

    5.1.7.7 Class template exponen-tial_distribution

    Y

    5.1.7.8 Class template normal_-distribution

    Y

    5.1.7.9 Class templategamma_distribution

    Y

    5.2 Mathematical specialfunctions Y

    5.2.1 Additions to header synopsis Y

    5.2.1.1 associated Laguerrepolynomials Y

    5.2.1.2 associated Legendrefunctions Y

    5.2.1.3 beta function Y

    5.2.1.4 (complete) elliptic integralof the first kind Y

    5.2.1.5 (complete) elliptic integralof the second kind Y

    5.2.1.6 (complete) elliptic integralof the third kind Y

    5.2.1.7 confluent hypergeometricfunctions Y

    5.2.1.8 regular modified cylindricalBessel functions Y

    5.2.1.9 cylindrical Bessel functions(of the first kind) Y

    5.2.1.10 irregular modifiedcylindrical Bessel functions Y

    5.2.1.11 cylindrical Neumannfunctions Y

    5.2.1.12 (incomplete) ellipticintegral of the first kind Y

    5.2.1.13 (incomplete) ellipticintegral of the second kind Y

    5.2.1.14 (incomplete) ellipticintegral of the third kind Y

    5.2.1.15 exponential integral Y5.2.1.16 Hermite polynomials Y5.2.1.17 hypergeometric functions Y5.2.1.18 Laguerre polynomials Y5.2.1.19 Legendre polynomials Y5.2.1.20 Riemann zeta function Y

    5.2.1.21 spherical Bessel functions(of the first kind) Y

    5.2.1.22 spherical associatedLegendre functions Y

    5.2.1.23 spherical Neumannfunctions Y

    5.2.2 Additions to header synopsis Y

    6 Containers6.1 Tuple types Y6.1.1 Header synopsis Y

    6.1.2 Additions to header synopsis Y

    6.1.3 Class template tuple Y6.1.3.1 Construction Y6.1.3.2 Tuple creation functions Y6.1.3.3 Tuple helper classes Y6.1.3.4 Element access Y6.1.3.5 Relational operators Y6.1.4 Pairs Y6.2 Fixed size array Y6.2.1 Header synopsis Y6.2.2 Class template array Y

    6.2.2.1 array constructors, copy,and assignment Y

    6.2.2.2 array specializedalgorithms Y

    6.2.2.3 array size Y6.2.2.4 Zero sized arrays Y

    6.2.2.5 Tuple interface to classtemplate array Y

    6.3 Unordered associativecontainers Y

    6.3.1 Unordered associativecontainer requirements Y

    6.3.1.1 Exception safety guarantees Y

    6.3.2 Additions to header synopsis Y

    6.3.3 Class template hash Y

    6.3.4 Unordered associativecontainer classes Y

    6.3.4.1Header

    synopsis

    Y

    6.3.4.2Header

    synopsis

    Y

    6.3.4.3 Class templateunordered_set

    Y

    6.3.4.3.1 unordered_setconstructors Y

    6.3.4.3.2 unordered_set swap Y

    6.3.4.4 Class templateunordered_map

    Y

    6.3.4.4.1 unordered_mapconstructors Y

    6.3.4.4.2 unordered_map elementaccess Y

    6.3.4.4.3 unordered_map swap Y

    6.3.4.5 Class templateunordered_multiset

    Y

    6.3.4.5.1 unordered_multisetconstructors Y

    6.3.4.5.2 unordered_multisetswap Y

    6.3.4.6 Class templateunordered_multimap

    Y

    6.3.4.6.1 unordered_multimapconstructors Y

    6.3.4.6.2 unordered_multimapswap Y

    7 Regular Expressions7.1 Definitions N7.2 Requirements N

    7.3 Regular expressionssummary N

    7.4 Header synopsis N

    7.5 Namespace tr1::rege-x_constants

    N

    7.5.1 Bitmask Typesyntax_option_type

    N

    7.5.2Bitmask Typeregex_constants::-match_flag_type

    N

    7.5.3 Implementation definederror_type

    N

    7.6 Class regex_error N

    7.7 Class templateregex_traits

    N

    7.8 Class templatebasic_regex

    N

    7.8.1 basic_regex constants N

    7.8.2 basic_regexconstructors N

    7.8.3 basic_regex assign N

    7.8.4 basic_regex constantoperations N

    7.8.5 basic_regex locale N7.8.6 basic_regex swap N

    7.8.7 basic_regexnon-member functions N

    7.8.7.1 basic_regexnon-member swap N

    7.9 Class templatesub_match

    N

    7.9.1 sub_match members N

    7.9.2 sub_match non-memberoperators N

    7.10 Class templatematch_results

    N

    7.10.1 match_resultsconstructors N

    7.10.2 match_results size N

    7.10.3 match_results elementaccess N

    7.10.4 match_resultsformatting N

    7.10.5 match_resultsallocator N

    7.10.6 match_results swap N

    7.11 Regular expressionalgorithms N

    7.11.1 exceptions N7.11.2 regex_match N7.11.3 regex_search N7.11.4 regex_replace N7.12 Regular expression Iterators N

    7.12.1 Class templateregex_iterator

    N

    7.12.1.1 regex_iteratorconstructors N

    7.12.1.2 regex_iteratorcomparisons N

    7.12.1.3 regex_iteratordereference N

    7.12.1.4 regex_iteratorincrement N

    7.12.2 Class template regex_t-oken_iterator

    N

    7.12.2.1regex_token_itera-torconstructors

    N

    7.12.2.2regex_token_itera-torcomparisons

    N

    7.12.2.3regex_token_itera-tordereference

    N

    7.12.2.4regex_token_itera-torincrement

    N

    7.13 Modified ECMAScriptregular expression grammar N

    8 C Compatibility

    8.1 Additions to header

    Y

    8.1.1 Synopsis Y8.1.2 Function acos Y8.1.3 Function asin Y8.1.4 Function atan Y8.1.5 Function acosh Y8.1.6 Function asinh Y8.1.7 Function atanh Y8.1.8 Function fabs Y8.1.9 Additional Overloads Y8.2 Header N DR 5518.3 Header N DR 551

    8.4 Additions to header

    Y

    8.4.1 Synopsis Y8.4.2 Function isblank Y

    8.5 Additions to header

    Y

    8.6 Header Y8.6.1 Synopsis Y8.6.2 Definitions Y8.7 Header Y

    8.8 Additions to header

    Y

    8.9 Additions to header

    Y

    8.10 Additions to header N8.10.1 Synopsis N8.10.2 Function hexfloat N8.11 Header Y8.11.1 Synopsis Y DR 5578.11.2 Definitions Y8.12 Header Y

    8.13 Additions to header

    Y

    8.14 Additions to header

    Y

    8.15 Additions to header

    N

    8.16 Additions to header

    Y

    8.16.1 Synopsis Y8.16.2 Definitions Y

    8.16.3 Function templatedefinitions Y

    8.16.4 Additional overloads Y DR 568; DR 550

    8.17 Additions to header

    Y

    8.18 Additions to header

    Y

    8.19 Additions to header

    Y

    8.20 The header Y8.21 The he