C++ Standard Library Header Files


The C++ standard library comprises of different types of libraries. The following is a list of all these Types with the libraries under them.

Utilities library

<cstdlib> − General purpose utilities like program control, dynamic memory allocation, random numbers, sort and search

<csignal>  −Functions and macro constants for signal management(eg SIGINT, etc)

<csetjmp>  −Macro (and function) that saves (and jumps) to an execution context

<cstdarg> − Handling of variable length argument lists

<typeinfo> − Runtime type information utilities

<bitset> − class template of std::bitset

<functional> − Function objects, Function invocations, Bind operations and Reference wrappers

<utility> − Various utility components

<ctime> − C-style time/date utilites

<cstddef> − standard macros and typedefs

<typeindex>(since C++11) − Wrapper around a type_info object, that can be used as index in associative and unordered associative containers

<type_traits> (since C++11) − Compile-time type information

<chrono> (since C++11) − C++ time utilites

<initializer_list> (since C++11) −Library defining a lightweight proxy object that provides access to an array of objects of type const T.

<tuple> (since C++11) − Library defining a fixed-size collection of heterogeneous values. It is a generalization of std::pair.

<any> (since C++17) − The class any describes a type-safe container for single values of any type.

<optional> (since C++17) − The class template std::optional manages an optional contained value, i.e. a value that may or may not be present.

<variant> (since C++17) −The class template std::variant represents a type-safe union. An instance of std:: variant at any given time either holds a value of one of its alternative types or in the case of error - no value.

<compare> (since C++20) − Allows three-way comparison operator support

Dynamic memory management

<new> − Low-level memory management utilities. The new-expression is the only way to create an object or an array of objects with dynamic storage duration, that is, with lifetime not restricted to the scope in which it is created.

<memory> − Higher level memory management utilities

<scoped_allocator> (since C++11) − The std::scoped_allocator_adaptor class template is an allocator which can be used with multilevel containers (vector of sets of lists of tuples of maps, etc).

<memory_resource> (since C++17) −The class std::pmr::memory_resource is an abstract interface to an unbounded set of classes encapsulating memory resources.

Numeric limits

<climits>  −limits of integral types

<cfloat> − limits of float types

<limits> −standardized way to query properties of arithmetic types

<cstdint> (since C++11) − fixed-size types and limits of other types

<cinttypes> (since C++11) − Provides conversions from C byte and wide strings to std::intmax_t and std::uintmax_t, overloads some math functions for std::intmax_t and provide C style input/output format macros for the types declared in <cstdint>.

Error handling

<exception> − Exception handling utilities

<stdexcept>  −Standard exception objects

<cassert> −Conditionally compiled macro that compares its argument to zero

<cerrno> −Macro containing the last error number

<system_error> (since C++11) −std::error_code is a platform-dependent error code. Each std::error_code object holds an error code originating from the operating system or some low-level interface and a pointer to an object of type std::error_category, which corresponds to the said interface.

Strings library

<cctype> − Functions to determine the type contained in character data

<cwctype> − Functions to determine the type contained in wide character data

<cstring> −various narrow character string handling functions

<cwchar> −various wide and multibyte string handling functions

<string> −std::basic_string class template

<cuchar> (since C++11) − C-style Unicode character conversion functions

<string_view> (since C++17) − The class template basic_string_view describes an object that can refer to a constant contiguous sequence of char-like objects with the first element of the sequence at position zero.

Containers library

<array> (since C++11) − std::array container

<vector> − std::vector container

<deque> − std::deque container

<list> − std::list container

<forward_list> (since C++11) − std::forward_list container

<set> − std::set and std::multiset associative containers

<map> − std::map and std::multimap associative containers

<unordered_set> (since C++11) − std::unordered_set and std::unordered_multiset unordered associative containers

<unordered_map> (since C++11) − std::unordered_map and std::unordered_multimap unordered associative containers

<stack> − std::stack container adaptor

<queue> − std::queue and std::priority_queue container adaptors

Algorithms library

<algorithm> − Contains algorithms that operate on containers

<execution> (C++17) −Predefined execution policies for parallel versions of the algorithms

Iterators library

<iterator> − Iterators for the containers

Numerics library

<cmath> − Common mathematics functions

<complex> − Complex number type

<valarray> − Class for representing and manipulating arrays of values

<random> (since C++11) − Random number generators and distributions

<numeric> − Numeric operations on values in containers

<ratio> (since C++11) −Compile-time rational arithmetic

<cfenv> (since C++11) − Floating-point environment access functions

Input/output library

<iosfwd> − forward declarations of all classes in the input/output library

<ios> − std::ios_base class, std::basic_ios class template and several typedefs

<istream> − std::basic_istream class template and several typedefs

<ostream> − std::basic_ostream, std::basic_iostream class templates and several typedefs

<iostream> − several standard stream objects

<fstream> − std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs

<sstream> − std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs

<syncstream> (since C++20) − std::basic_osyncstream, std::basic_syncbuf, and typedefs

<strstream>(deprecated) − std::strstream, std::istrstream, std::ostrstream

<iomanip> − Helper functions to control the format or input and output

<streambuf> − std::basic_streambuf class template

<cstdio> − C-style input-output functions

Localization library

<locale> − Localization utilities

<clocale> − C localization utilities

<codecvt> (since C++11) (deprecated in C++17) − Unicode conversion facilities

Regular Expressions library

<regex> (since C++11)  − Classes, algorithms and iterators to support regular expression processing

Atomic Operations library

<atomic> (since C++11) − Atomic operations library

Thread support library

<thread> (since C++11) − std::thread class and supporting functions

<mutex> (since C++11) − mutual exclusion primitives

<shared_mutex> (since C++14) − shared mutual exclusion primitives

<future> (since C++11) −primitives for asynchronous computations

<condition_variable> (since C++11) − thread waiting conditions

Filesystem library

<filesystem> (since C++17) − std::path class and supporting functions

Updated on: 18-Jun-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements