C++ Standard Library Header Files



Standard Library header files are the predefined files in C++, which are part of the built-in library. It consists of declarations for functions, classes, objects, and macros. These header files give you access to perform various operations like input/output, string manipulation, containers, algorithms, math operations, and many more.

Here is the following list of all the types of libraries under the standard Library Header Files.

Utilities library

These types of libraries consist of standard header files that provide basic programming needs, like memory management, function wrappers, and basic program support features like pair, tuple, move, swap, and many more.

<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 an index in associative and unordered associative containers
<type_traits> (since C++11) Compile-time type information
<chrono> (since C++11) C++ time utilities
<initializer_list> (since C++11) The library defines 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

These libraries consist of header files that support memory operations like allocation, deallocation, and smart pointer usage. It allows for efficient and better handling of dynamic memory.

<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 a 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 that 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

These header files provide important tools to work with characteristics, ranges, and limits of built-in and fixed-width numeric types.

<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 provides C style input/output format macros for the types declared in <cstdint>.

Error handling

These header files provide support for managing and reporting errors during program execution. It gives exception types, error codes, and system error messages.

<exception> Exception handling utilities
<stdexcept> Standard exception objects
<cassert> A 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

This type of library includes standard headers, which provide manipulating and processing strings. It supports both narrow and wide character strings, providing features like concatenation, comparison, searching, modification, and conversion, etc.

<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

This library consists of header files that define standard container classes like vector, list, map, set, and more. These containers allow developers to store collections of data with built-in dynamic support like resizing, iteration, sorting, and efficient access.

<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 are unordered associative containers
<stack> std::stack container adaptor
<queue> std::queue and std::priority_queue container adaptors

Algorithms library

This library provides a collection of built-in functions to perform common operations on data structures like searching, sorting, comparing, and modifying, etc.

<algorithm> Contains algorithms that operate on containers
<execution> (C++17) Predefined execution policies for parallel versions of the algorithms

Iterators library

This library provides header files that support traversing and manipulating elements of the containers like arrays, vectors, lists, and maps.

<iterator> Iterators for the containers

Numeric library

This library includes header files that support arithmetic and numeric calculations, complex numbers, managing ratios, etc. This helps developers to work with numerical code efficiently.

<cmath> Common mathematical 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

This library gives access to perform reading from input devices (eg, keyboard) and writing to output devices (eg, console or files).

<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

This library provides support for writing programs to adapt to different languages, cultures, and regional settings, such as number formats, date/time formats, and currency symbols etc.

<locale> Localization utilities
<clocale> C localization utilities
<codecvt> (since C++11) (deprecated in C++17) Unicode conversion facilities

Regular Expressions library

It provides support for searching and manipulating strings using regular expression patterns.

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

Atomic Operations library

This provides support for performing atomic operations (operation completed in single steps) on shared data, which helps for the safe manipulation of shared variables in multi-threaded applications.

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

Thread support library

This library provides header files that help in multithreading programming, allowing the program to execute multiple threads concurrently.

<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

This provides tools to work with the file system, like file paths, directories, file status, and other file-related operations. This header file was officially introduced in C++17.

<filesystem> (since C++17) std::path class and supporting functions
Updated on: 2025-05-12T19:38:45+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements