The GNU C++ Library Documentation

Paolo Carlini

Phil Edwards

Doug Gregor

Benjamin Kosnik

Dhruv Matani

Jason Merrill

Mark Mitchell

Nathan Myers

Felix Natter

Stefan Olsson

Johannes Singler

Ami Tavory

Jonathan Wakely


Table of Contents

The GNU C++ Library
I. Introduction
1. Status
Implementation Status
C++ 1998/2003
C++ TR1
C++ 200x
License
The Code: GPL
The Documentation: GPL, FDL
Bugs
Implementation Bugs
Standard Bugs
2. Setup
Prerequisites
Configure
Make
Test
Organization
Running the Testsuite
Writing a new test case
Test Harness and Utilities
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
Propagating Exceptions aka Exception Neutrality
Exception Safety
Support for -fno-exceptions
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
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
Cancellation
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
More 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. Allocators
mt_allocator
Intro
Design Issues
Implementation
Single Thread Example
Multiple Thread Example
bitmap_allocator
Design
Implementation
33. Containers
Policy Based Data Structures
HP/SGI
Deprecated HP/SGI
34. Utilities
35. Algorithms
36. Numerics
37. Iterators
38. Input and Output
Derived filebufs
39. Demangling
40. 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
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
API and Source Level Documentation
Frequently Asked Questions