Table of Contents
C++ Utility library
https://en.cppreference.com/w/cpp/utility
C++ includes a variety of utility libraries that provide functionality ranging from bit-counting to partial function application. These libraries can be broadly divided into two groups:
- language support libraries, and
- general-purpose libraries.
Language support
Language support libraries provide classes and functions that interact closely with language features and support common language idioms.
[[cpp/types|Type support]]
Basic types (e.g.
,
), RTTI (e.g.
), type traits (e.g.
,
)
Constant evaluation context
[[cpp/utility/feature_test|Implementation properties]]
supplies implementation-dependent information about the C++ standard library (such as the version number and release date). It also defines the library feature-test macros. }}
[[cpp/utility/program | Program utilities]]
Termination (e.g.
,
), environment (e.g.
), signals (e.g.
)
[[cpp/memory|Dynamic memory management]]
Smart pointers (e.g.
), allocators (e.g.
or
), C-style memory management (e.g.
)
Object access
[[cpp/error|Error handling]]
Exceptions (e.g.
,
), assertions (e.g.
)
[[cpp/utility/source_location|Source code information capture]]
[[cpp/utility/initializer_list|Initializer lists]]
Three-way comparison
[[cpp/coroutine|Coroutine support]]
,
. }}
[[cpp/utility/variadic|Variadic functions]]
Support for functions that take an arbitrary number of parameters (via e.g.
,
,
)
General-purpose utilities
Swap and type operations
Integer comparison functions
Relational operators
[[cpp/utility/pair|Pairs]] and [[cpp/utility/tuple|tuples]]
[[cpp/utility/optional|Optional]], [[cpp/utility/variant|variant]] and [[cpp/utility/any|any]]
[[cpp/utility/bitset|Bitset]]
[[cpp/utility/functional|Function objects]]
Partial function application (e.g.
) and related utilities: utilities for binding such as
and
, polymorphic function wrappers:
, predefined functors (e.g.
,
), method to function converters
.
[[cpp/utility/hash|Hash support]]
[[cpp/chrono|Date and time]]
Time tracking (e.g.
,
), C-style date and time (e.g.
,
)
Elementary string conversions
In addition to sophisticated locale-dependent parsers and formatters provided by the C++ I/O library, the C I/O library, C++ string converters, and C string converters, the header
provides light-weight, locale-independent, non-allocating, non-throwing parsers and formatters for arithmetic types.
<!– including to_chars_result –>
<!– including from_chars_result –>
[[cpp/utility/format|Formatting library]]
Facilities for type-safe string formatting.