Dinkum C++14 Libraries

Use of this Dinkum C++14 Libraries Reference is subject to limitations. See the copyright notice at the end of this page for detailed restrictions.


Table of Contents · Introduction · Standard C++ Library · Standard C Library · ISO Technical Reports · Compatibility Extensions · Additional Libraries · C Locales · Overviews · This Implementation


Table of Contents

The Dinkum C++14 Libraries are organized into a number of headers, files that you include in your program to declare or define library facilities. Thus, most of the material in this Library Reference is organized by headers, listed below to simplify top-down searching. To search bottom up for a specific name or term, see the Index.

C++03 Headers:

<algorithm> · <array> · <bitset> · <cassert> · <ccomplex> · <cctype> · <cerrno> · <cfenv> · <cfloat> · <cinttypes> · <ciso646> · <climits> · <clocale> · <cmath> · <complex> · <csetjmp> · <csignal> · <cstdarg> · <cstdbool> · <cstddef> · <cstdint> · <cstdio> · <cstdlib> · <cstring> · <ctgmath> · <ctime> · <cwchar> · <cwctype> · <deque> · <exception> · <fstream> · <functional> · <hash_map> · <hash_set> · <iomanip> · <ios> · <iosfwd> · <iostream> · <istream> · <iterator> · <limits> · <list> · <locale> · <map> · <memory> · <new> · <numeric> · <ostream> · <queue> · <random> · <regex> · <set> · <slist> · <sstream> · <stack> · <stdexcept> · <streambuf> · <string> · <strstream> · <tuple> · <typeinfo> · <type_traits> · <unordered_map> · <unordered_set> · <utility> · <valarray> · <vector>

Added C++11 headers:

<atomic> · <chrono> · <codecvt> · <condition_variable> · <cstdalign> · <cuchar> · <forward_list> · <future> · <initializer_list> · <mutex> · <ratio> · <scoped_allocator> · <system_error> · <thread> · <typeindex>

Added C++14 header:

<filesystem>

C03 Headers:

<assert.h> · <complex.h> · <ctype.h> · <errno.h> · <fenv.h> · <float.h> · <inttypes.h> · <iso646.h> · <limits.h> · <locale.h> · <math.h> · <setjmp.h> · <signal.h> · <stdarg.h> · <stdbool.h> · <stddef.h> · <stdint.h> · <stdio.h> · <stdlib.h> · <string.h> · <tgmath.h> · "Dinkum/threads/threads.h" · <time.h> · <wchar.h> · <wctype.h> · "Dinkum/threads/xtimec.h"

Added C11 Headers:

<stdalign.h> · <uchar.h>

Added Dinkumware headers (in include/Dinkum):

"allocators" · "threads/condition" · "threads/exceptions" · "threads/mutex" · "threads/once" · "threads/recursive_mutex" · "threads/thread" · "threads/tss" · "codecvt/wbuffer" · "codecvt/wstring" · "threads/xtime"

Overviews:

C++ Library Overview · C Library Overview · Characters · Files and Streams · Formatted Output · Formatted Input · STL Conventions · STL Containers · Random Number Generators · Regular Expressions · Thread Safety


Introduction

The Dinkum C++14 Libraries are a collection of several C and C++ libraries, all based on ISO standards. These libraries include a large number of functions that perform essential services such as input/output and storage allocation. They also provide efficient implementations of frequently used operations. Numerous other function and class definitions accompany these functions to help you to make better use of the library. In one coherent package, you get:

The Libraries have been tested on a variety of compilers:

Note that not all compilers support the language features required to support all features in the Dinkum C++14 Libraries. The Library often provides reasonable alternative forms to avoid missing language features, but that is not always possible. As a general rule, you can expect reasonably complete library functionality when using Microsoft Visual C++ compilers from V10 onward, GCC compilers from V4.0 onward, and all compilers using the EDG front end.

Standard C++ Library

The Standard C++ library as revised through 2003 (C++03) consists of 51 headers. Of these, 16 constitute the Standard Template Library, or STL. These are indicated below with the notation (STL):

<algorithm> -- (STL) for defining numerous templates that implement useful algorithms
<bitset> -- for defining a template class that administers sets of bits
<complex> -- for defining a template class that supports complex arithmetic
<deque> -- (STL) for defining a template class that implements a deque container
<exception> -- for defining several functions that control exception handling
<fstream> -- for defining several iostreams template classes that manipulate external files
<functional> -- (STL) for defining several templates that help construct predicates for the templates defined in <algorithm> and <numeric>
<iomanip> -- for declaring several iostreams manipulators that take an argument
<ios> -- for defining the template class that serves as the base for many iostreams classes
<iosfwd> -- for declaring several iostreams template classes before they are necessarily defined
<iostream> -- for declaring the iostreams objects that manipulate the standard streams
<istream> -- for defining the template class that performs extractions
<iterator> -- (STL) for defining several templates that help define and manipulate iterators
<limits> -- for testing numeric type properties
<list> -- (STL) for defining a template class that implements a doubly linked list container
<locale> -- for defining several classes and templates that control locale-specific behavior, as in the iostreams classes
<map> -- (STL) for defining template classes that implement associative containers that map keys to values
<memory> -- (STL) for defining several templates that allocate and free storage for various container classes
<new> -- for declaring several functions that allocate and free storage
<numeric> -- (STL) for defining several templates that implement useful numeric functions
<ostream> -- for defining the template class that performs insertions
<queue> -- (STL) for defining a template class that implements a queue container
<set> -- (STL) for defining template classes that implement associative containers
<sstream> -- for defining several iostreams template classes that manipulate string containers
<stack> -- (STL) for defining a template class that implements a stack container
<stdexcept> -- for defining several classes useful for reporting exceptions
<streambuf> -- for defining template classes that buffer iostreams operations
<string> -- for defining a template class that implements a string container
<strstream> -- for defining several iostreams classes that manipulate in-memory character sequences
<typeinfo> -- for defining class type_info, the result of the typeid operator
<utility> -- (STL) for defining several templates of general utility
<valarray> -- for defining several classes and template classes that support value-oriented arrays
<vector> -- (STL) for defining a template class that implements a vector container

The Standard C++ library works in conjunction with the headers from the Standard C library, sometimes with small alterations. The headers come in two forms, new (C++03) and traditional (C03). The new-form headers are:

<cassert> -- for enforcing assertions when functions execute
<ccomplex> -- for performing complex arithmetic
<cctype> -- for classifying characters
<cerrno> -- for testing error codes reported by library functions
<cfenv> -- for controlling IEEE-style floating-point arithmetic
<cfloat> -- for testing floating-point type properties
<cinttypes> -- for converting various integer types
<ciso646> -- for programming in ISO 646 variant character sets
<climits> -- for testing integer type properties
<clocale> -- for adapting to different cultural conventions
<cmath> -- for computing common mathematical functions
<csetjmp> -- for executing nonlocal goto statements
<csignal> -- for controlling various exceptional conditions
<cstdarg> -- for accessing a varying number of arguments
<cstdbool> -- for defining a convenient Boolean type name and constants
<cstddef> -- for defining several useful types and macros
<cstdint> -- for defining various integer types with size constraints
<cstdio> -- for performing input and output
<cstdlib> -- for performing a variety of operations
<cstring> -- for manipulating several kinds of strings
<ctgmath> -- for defining generic forms of math functions
<ctime> -- for converting between various time and date formats
<cwchar> -- for manipulating wide streams and several kinds of strings
<cwctype> -- for classifying wide characters

Added with C++11 are:

<array> -- for defining a fixed-size array with a container-like interface
<atomic> -- for defining classes and objects that manage atomic data operations
<chrono> -- for defining time points and durations
<codecvt> -- for defining locale facets that convert between different Unicode encodings
<condition_variable> -- for defining classes that manage inter-thread synchronization
<cstdalign> -- for ensuring that alignas is defined
<cuchar> -- for manipulating 16-bit and 32-bit UNICODE wide characters
<forward_list> -- (STL) for defining a template class that implements a small-footprint singly linked list container
<future> -- for defining classes and objects that simplify running a function in a thread and getting its result in another thread
<initializer_list> -- for describing a brace-enclosed initializer list
<mutex> -- for defining classes that manage mutual exclusion between threads
<random> -- for defining random number generators
<ratio> -- for defining templates that implement compile-time rational numbers
<regex> -- for defining a regular-expression matcher
<scoped_allocator> -- for wrapping a nest of allocators
<system_error> -- for wrapping low-level system errors
<thread> -- for defining classes and functions to create and manage threads
<tuple> -- for defining an ordered collection of subobjects
<typeindex> -- for defining classes and functions to index typeinfo objects
<type_traits> -- for accessing detailed type information at compile time to support generic programming
<unordered_map> -- (STL) for defining template classes that implement unordered associative containers that map keys to values
<unordered_set> -- (STL) for defining template classes that implement unordered associative containers
<typeindex> -- for defining classes and functions to index typeinfo objects

Beginning with the C++ Standard as revised through 2014, usually referred to as C++14, another header is added.

<filesystem> -- for manipulating directory structures in ways that are powerful, yet portable across operating systems

Standard C Library

The traditional Standard C library headers (C03), which are also a part of the Standard C++ Library (C++03), are:

<assert.h> -- for enforcing assertions when functions execute
<complex.h> -- for performing complex arithmetic
<ctype.h> -- for classifying characters
<errno.h> -- for testing error codes reported by library functions
<fenv.h> -- for controlling IEEE-style floating-point arithmetic
<float.h> -- for testing floating-point type properties
<inttypes.h> -- for converting various integer types
<iso646.h> -- for programming in ISO 646 variant character sets
<limits.h> -- for testing integer type properties
<locale.h> -- for adapting to different cultural conventions
<math.h> -- for computing common mathematical functions
<setjmp.h> -- for executing nonlocal goto statements
<signal.h> -- for controlling various exceptional conditions
<stdarg.h> -- for accessing a varying number of arguments
<stdbool.h> -- for defining a convenient Boolean type name and constants
<stddef.h> -- for defining several useful types and macros
<stdint.h> -- for defining various integer types with size constraints
<stdio.h> -- for performing input and output
<stdlib.h> -- for performing a variety of operations
<string.h> -- for manipulating several kinds of strings
<tgmath.h> -- for declaring various type-generic math functions
<time.h> -- for converting between various time and date formats
<wchar.h> -- for manipulating wide streams and several kinds of strings
<wctype.h> -- for classifying wide characters

Added with C11 are:

<stdalign> -- for ensuring that alignas is defined
<uchar.h> -- for manipulating 16-bit and 32-bit UNICODE wide characters

ISO Technical Reports

An important stepping stone from C++03 to C++11 first appeared in the ISO Technical Report TR19768 (better known as Library TR1). Its numerous contributions to C++11 are identified, as much as possible, by the tag [added with TR1].

ISO/IEC TR24731 defines C Library Extension 1, which adds a number of functions to existing headers that check arguments for unexpected null pointers, short buffers, and other common errors. The functions are based on additions made by Microsoft to Visual C++ 2005 (V8). The contributions occur in <errno.h>, <stddef.h>, <stdint.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, and <wchar.h>.

Compatibility Extensions

The Dinkum C++14 Libraries include several headers that provide extensions frequently found in other C++ libraries:

<hash_map> -- (STL) for defining template classes that implement hashed associative containers that map keys to values (also includes an STLport-compatible adapter)
<hash_set> -- (STL) for defining template classes that implement hashed associative containers (also includes an STLport-compatible adapter)
<slist> -- (STL) for defining a template class that implements a singly linked list container

Additional Libraries

The Dinkum C++14 Libraries include several libraries not required by ISO standards, but whose presence are suggested, or even encouraged, by those standards:

C Locales

See the Green Hills Software manual for information pertaining to C locales.

Overviews

Other information on the Standard C and C++ libraries includes several overviews:

C++ Library Overview -- how to use the Standard C++ library, including alternative mechanisms for handling exceptions
C Library Overview -- how to use the Standard C library, including what happens at program startup and at program termination
Characters -- how to write character constants and string literals, and how to convert between multibyte characters and wide characters
Files and Streams -- how to read and write data between the program and files
Formatted Output -- how to generate text under control of a format string
Formatted Input -- how to scan and parse text under control of a format string
STL Conventions -- how to read the descriptions of STL template classes and functions
STL Containers -- how to use an arbitrary STL container template class
Random Number Generators -- how to use the generators and distributions defined in <random>
Regular Expressions -- how to write regular expressions defined in <regex>
Thread Safety -- how to write code that is safe in a multithreaded environment

This Implementation

As much as possible, this Reference indicates any extensions to standard-conforming behavior particular to this implementation. Moreover, even though the C++ Standard is no longer new it continues to evolve, so not all compilers support all the features described here. Hence, this implementation introduces macros, or alternative declarations, where necessary to provide reasonable substitutes for the capabilities required by the C++ Standard.


See also the Index.

Copyright (c) by P.J. Plauger. All rights reserved.