The GNU C++ Library
Prev
Next
The GNU C++ Library
Copyright © 2009
FSF
License
Table of Contents
I. Introduction
1. Status
Implementation Status
C++ 1998/2003
C++ TR1
C++ 200x
C++ TR 24733
License
The Code: GPL
The Documentation: GPL, FDL
Bugs
Implementation Bugs
Standard Bugs
2. Setup
Prerequisites
Configure
Make
3. Using
Linking Library Binary Files
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Macros
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis
II. Support
4. Types
Fundamental Types
Numeric Properties
NULL
5. Dynamic Memory
6. Termination
Termination Handlers
Verbose Terminate Handler
III. Diagnostics
7. Exceptions
Exception Classes
Adding Data to Exceptions
8. Concept Checking
IV. Utilities
9. Functors
10. Pairs
11. Memory
Allocators
Requirements
Design Issues
Implementation
Using a Specific Allocator
Custom Allocators
Extension Allocators
auto_ptr
Limitations
Use in Containers
shared_ptr
Requirements
Design Issues
Implementation
Use
Acknowledgments
12. Traits
V. Strings
13. String Classes
Simple Transformations
Case Sensitivity
Arbitrary Character Types
Tokenizing
Shrink to Fit
CString (MFC)
VI. Localization
14. Locales
locale
Requirements
Design
Implementation
Future
15. Facets aka Categories
ctype
Implementation
Future
codecvt
Requirements
Design
Implementation
Use
Future
messages
Requirements
Design
Implementation
Use
Future
VII. Containers
16. Sequences
list
list::size() is O(n)
vector
Space Overhead Management
17. Associative
Insertion Hints
bitset
Size Variable
Type String
18. Interacting with C
Containers vs. Arrays
VIII. Iterators
19. Predefined
Iterators vs. Pointers
One Past the End
IX. Algorithms
20. Mutating
swap
Specializations
X. Numerics
21. Complex
complex Processing
22. Generalized Operations
23. Interacting with C
Numerics vs. Arrays
C99
XI. Input and Output
24. Iostream Objects
25. Stream Buffers
Derived streambuf Classes
Buffering
26. Memory Based Streams
Compatibility With strstream
27. File Based Streams
Copying a File
Binary Input and Output
28. Interacting with C
Using FILE* and file descriptors
Performance
XII. Extensions
29. Compile Time Checks
30. Debug Mode
Intro
Semantics
Using
Using the Debug Mode
Using a Specific Debug Container
Design
Goals
Methods
Other Implementations
31. Parallel Mode
Intro
Semantics
Using
Prerequisite Compiler Flags
Using Parallel Mode
Using Specific Parallel Components
Design
Interface Basics
Configuration and Tuning
Implementation Namespaces
Testing
Bibliography
32. Profile Mode
Intro
Using the Profile Mode
Tuning the Profile Mode
Design
Wrapper Model
Instrumentation
Run Time Behavior
Analysis and Diagnostics
Cost Model
Reports
Testing
Extensions for Custom Containers
Empirical Cost Model
Implementation Issues
Stack Traces
Symbolization of Instruction Addresses
Concurrency
Using the Standard Library in the Instrumentation Implementation
Malloc Hooks
Construction and Destruction of Global Objects
Developer Information
Big Picture
How To Add A Diagnostic
Diagnostics
Diagnostic Template
Containers
Algorithms
Data Locality
Multithreaded Data Access
Statistics
Bibliography
33. Allocators
mt_allocator
Intro
Design Issues
Implementation
Single Thread Example
Multiple Thread Example
bitmap_allocator
Design
Implementation
34. Containers
Policy Based Data Structures
HP/SGI
Deprecated HP/SGI
35. Utilities
36. Algorithms
37. Numerics
38. Iterators
39. Input and Output
Derived filebufs
40. Demangling
41. Concurrency
Design
Interface to Locks and Mutexes
Interface to Atomic Functions
Implementation
Using Builtin Atomic Functions
Thread Abstraction
Use
A. Contributing
Contributor Checklist
Reading
Assignment
Getting Sources
Submitting Patches
Directory Layout and Source Conventions
Coding Style
Bad Identifiers
By Example
Documentation Style
Doxygen
Docbook
Design Notes
B. Porting and Maintenance
Configure and Build Hacking
Prerequisites
Overview: What Comes from Where
Storing Information in non-AC files (like configure.host)
Coding and Commenting Conventions
The acinclude.m4 layout
GLIBCXX_ENABLE, the --enable maker
Porting to New Hardware or Operating Systems
Operating System
CPU
Character Types
Thread Safety
Numeric Limits
Libtool
Test
Organization
Running the Testsuite
Writing a new test case
Test Harness and Utilities
ABI Policy and Guidelines
The C++ Interface
Versioning
Allowed Changes
Prohibited Changes
Implementation
Testing
Outstanding Issues
API Evolution and Deprecation History
3.0
3.1
3.2
3.3
3.4
4.0
4.1
4.2
4.3
Backwards Compatibility
First
Second
Third
C. Free Software Needs Free Documentation
D. GNU General Public License version 3
E. GNU Free Documentation License
Index
List of Tables
1.1.
C++ 1998/2003 Implementation Status
1.2.
C++ TR1 Implementation Status
1.3.
C++ 200x Implementation Status
1.4.
C++ TR 24733 Implementation Status
3.1.
C++ 1998 Library Headers
3.2.
C++ 1998 Library Headers for C Library Facilities
3.3.
C++ 200x Library Headers
3.4.
C++ 200x Library Headers for C Library Facilities
3.5.
C++ TR 1 Library Headers
3.6.
C++ TR 1 Library Headers for C Library Facilities
3.7.
C++ TR 24733 Decimal Floating-Point Header
3.8.
C++ ABI Headers
3.9.
Extension Headers
3.10.
Extension Debug Headers
3.11.
Extension Profile Headers
3.12.
Extension Parallel Headers
30.1.
Debugging Containers
30.2.
Debugging Containers C++0x
31.1.
Parallel Algorithms
32.1.
Code Location
32.2.
Diagnostics
33.1.
Bitmap Allocator Memory Map
A.1.
HTML to Docbook XML markup comparison
A.2.
Docbook XML Element Use
B.1.
Extension Allocators
B.2.
Extension Allocators Continued