"cpp/utility/tuple") (C++11)  
[ optional  ](/w/cpp/utility/optional "cpp/utility/optional") (C++17)  
[ any  ](/w/cpp/utility/any "cpp/utility/any") (C++17)  
[ variant  ](/w/cpp/utility/variant "cpp/utility/variant") (C++17)  
  
|  [ tuple_size  ](/w/cpp/utility/tuple_size "cpp/utility/tuple size") (C++11)  
---  
[ tuple_element  ](/w/cpp/utility/tuple_element "cpp/utility/tuple element")
(C++11)  
[ apply  ](/w/cpp/utility/apply "cpp/utility/apply") (C++17)  
[ make_from_tuple  ](/w/cpp/utility/make_from_tuple "cpp/utility/make from
tuple") (C++17)  
[ expected  ](/w/cpp/utility/expected "cpp/utility/expected") (C++23)  
  
[ Elementary string conversions ](/w/cpp/utility#Elementary_string_conversions
"cpp/utility")  
|  [ to_chars  ](/w/cpp/utility/to_chars "cpp/utility/to chars") (C++17)  
---  
[ from_chars  ](/w/cpp/utility/from_chars "cpp/utility/from chars") (C++17)  
[ chars_format  ](/w/cpp/utility/chars_format "cpp/utility/chars format")
(C++17)  
  
|  [ to_chars_result  ](/w/cpp/utility/to_chars_result "cpp/utility/to chars
result") (C++17)  
---  
[ from_chars_result  ](/w/cpp/utility/from_chars_result "cpp/utility/from
chars result") (C++17)  
  
  
  
  
  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/navbar_content&action=edit)

C++ includes a variety of utility libraries that provide functionality ranging
from [ bit-counting ](/w/cpp/utility/bitset "cpp/utility/bitset") to [ partial
function application ](/w/cpp/utility/functional/bind
"cpp/utility/functional/bind") . These libraries can be broadly divided into
two groups:

  * language support libraries, and 
  * general-purpose libraries. 

##  Contents

  * 1  Language support 
    * 1.1  Type support 
    * 1.2  Metaprogramming 
    * 1.3  Constant evaluation context 
    * 1.4  Implementation properties 
    * 1.5  Program utilities 
    * 1.6  Dynamic memory management 
    * 1.7  Error handling 
    * 1.8  Source code information capture 
    * 1.9  Debugging support 
    * 1.10  Initializer lists 
    * 1.11  Three-way comparison 
    * 1.12  Coroutine support 
    * 1.13  Variadic functions 
  * 2  General-purpose utilities 
    * 2.1  Swap 
    * 2.2  Type operations 
    * 2.3  Integer comparison functions 
    * 2.4  Relational operators 
    * 2.5  Pairs and tuples 
      * 2.5.1  Tuple protocol 
    * 2.6  Sum types and type erased wrappers 
    * 2.7  Bitset 
    * 2.8  Function objects 
    * 2.9  Hash support 
    * 2.10  Date and time 
    * 2.11  Elementary string conversions 
    * 2.12  Formatting library 
    * 2.13  See also 

  
---  
  
##  [ [ edit ](/mwiki/index.php?title=cpp/utility&action=edit&section=1 "Edit
section: Language support") ]  Language support

Language support libraries provide classes and functions that interact closely
with language features and support common language idioms.

###  [ [ edit ](/mwiki/index.php?title=cpp/utility&action=edit&section=2 "Edit
section: Type support") ]  [ Type support ](/w/cpp/types "cpp/types")

Basic types (e.g.  [ std::size_t ](/w/cpp/types/size_t "cpp/types/size t") ,
[ std::nullptr_t ](/w/cpp/types/nullptr_t "cpp/types/nullptr t") ), RTTI (e.g.
[ std::type_info ](/w/cpp/types/type_info "cpp/types/type info") )

###  [ [ edit ](/mwiki/index.php?title=cpp/utility&action=edit&section=3 "Edit
section: Metaprogramming") ]  [ Metaprogramming ](/w/cpp/meta "cpp/meta")

Type traits (e.g.  [ std::is_integral ](/w/cpp/types/is_integral "cpp/types/is
integral") ,  [ std::rank ](/w/cpp/types/rank "cpp/types/rank") ), compile-
time constants (e.g.  [ std::integer_sequence
](/w/cpp/utility/integer_sequence "cpp/utility/integer sequence") ,  [
std::ratio ](/w/cpp/numeric/ratio/ratio "cpp/numeric/ratio/ratio") )

###  [ [ edit ](/mwiki/index.php?title=cpp/utility&action=edit&section=4 "Edit
section: Constant evaluation context") ]  Constant evaluation context

Defined in header ` [ <type_traits> ](/w/cpp/header/type_traits
"cpp/header/type traits") `  
--