libstdc++
Utilities
Collaboration diagram for Utilities:

Modules

 Function Objects
 
 Memory
 
 Metaprogramming
 
 Rational Arithmetic
 
 Time
 

Classes

struct  std::_Tuple_impl< _Idx, _Elements >
 
struct  std::_Tuple_impl< _Idx, _Head, _Tail... >
 
class  std::bitset< _Nb >
 
struct  std::pair< _T1, _T2 >
 
struct  std::piecewise_construct_t
 
class  std::tuple< _Elements >
 
class  std::tuple< _T1, _T2 >
 
struct  std::tuple_element< 0, tuple< _Head, _Tail... > >
 
struct  std::tuple_element< __i, tuple< _Head, _Tail... > >
 
struct  std::tuple_element< __i, tuple<> >
 
struct  std::tuple_size< tuple< _Elements... > >
 
struct  std::type_index
 
struct  std::uses_allocator< tuple< _Types... >, _Alloc >
 

Macros

#define __cpp_lib_tuples_by_type
 

Typedefs

template<typename _Tp >
using std::__empty_not_final = typename conditional< __is_final(_Tp), false_type, __is_empty_non_tuple< _Tp > >::type
 

Functions

template<typename... _Args1, typename... _Args2>
 std::pair< _T1, _T2 >::pair (piecewise_construct_t, tuple< _Args1... >, tuple< _Args2... >)
 
template<typename _Tp >
constexpr _Tp * std::__addressof (_Tp &__r) noexcept
 
template<typename _Tp , typename _Up = _Tp>
_Tp std::__exchange (_Tp &__obj, _Up &&__new_val)
 
template<std::size_t __i, typename _Head , typename... _Tail>
constexpr _Head & std::__get_helper (_Tuple_impl< __i, _Head, _Tail... > &__t) noexcept
 
template<std::size_t __i, typename _Head , typename... _Tail>
constexpr const _Head & std::__get_helper (const _Tuple_impl< __i, _Head, _Tail... > &__t) noexcept
 
template<typename _Head , size_t __i, typename... _Tail>
constexpr _Head & std::__get_helper2 (_Tuple_impl< __i, _Head, _Tail... > &__t) noexcept
 
template<typename _Head , size_t __i, typename... _Tail>
constexpr const _Head & std::__get_helper2 (const _Tuple_impl< __i, _Head, _Tail... > &__t) noexcept
 
template<typename _Tp , typename _Up = typename __inv_unwrap<_Tp>::type>
constexpr _Up && std::__invfwd (typename remove_reference< _Tp >::type &__t) noexcept
 
template<typename _Callable , typename... _Args>
constexpr __invoke_result< _Callable, _Args... >::type std::__invoke (_Callable &&__fn, _Args &&... __args) noexcept(__is_nothrow_invocable< _Callable, _Args... >::value)
 
template<typename _Res , typename _Fn , typename... _Args>
constexpr _Res std::__invoke_impl (__invoke_other, _Fn &&__f, _Args &&... __args)
 
template<typename _Res , typename _MemFun , typename _Tp , typename... _Args>
constexpr _Res std::__invoke_impl (__invoke_memfun_ref, _MemFun &&__f, _Tp &&__t, _Args &&... __args)
 
template<typename _Res , typename _MemFun , typename _Tp , typename... _Args>
constexpr _Res std::__invoke_impl (__invoke_memfun_deref, _MemFun &&__f, _Tp &&__t, _Args &&... __args)
 
template<typename _Res , typename _MemPtr , typename _Tp >
constexpr _Res std::__invoke_impl (__invoke_memobj_ref, _MemPtr &&__f, _Tp &&__t)
 
template<typename _Res , typename _MemPtr , typename _Tp >
constexpr _Res std::__invoke_impl (__invoke_memobj_deref, _MemPtr &&__f, _Tp &&__t)
 
template<typename _Tp >
_GLIBCXX17_CONSTEXPR _Tp * std::addressof (_Tp &__r) noexcept
 
template<typename _Tp >
const _Tp * std::addressof (const _Tp &&)=delete
 
template<typename _Tp >
constexpr _Tp && std::forward (typename std::remove_reference< _Tp >::type &__t) noexcept
 
template<typename _Tp >
constexpr _Tp && std::forward (typename std::remove_reference< _Tp >::type &&__t) noexcept
 
template<typename... _Elements>
constexpr tuple< _Elements &&... > std::forward_as_tuple (_Elements &&... __args) noexcept
 
template<std::size_t __i, typename... _Elements>
constexpr __tuple_element_t< __i, tuple< _Elements... > > & std::get (tuple< _Elements... > &__t) noexcept
 
template<std::size_t __i, typename... _Elements>
constexpr const __tuple_element_t< __i, tuple< _Elements... > > & std::get (const tuple< _Elements... > &__t) noexcept
 
template<std::size_t __i, typename... _Elements>
constexpr __tuple_element_t< __i, tuple< _Elements... > > && std::get (tuple< _Elements... > &&__t) noexcept
 
template<std::size_t __i, typename... _Elements>
constexpr const __tuple_element_t< __i, tuple< _Elements... > > && std::get (const tuple< _Elements... > &&__t) noexcept
 
template<typename _Tp , typename... _Types>
constexpr _Tp & std::get (tuple< _Types... > &__t) noexcept
 
template<typename _Tp , typename... _Types>
constexpr _Tp && std::get (tuple< _Types... > &&__t) noexcept
 
template<typename _Tp , typename... _Types>
constexpr const _Tp & std::get (const tuple< _Types... > &__t) noexcept
 
template<typename _Tp , typename... _Types>
constexpr const _Tp && std::get (const tuple< _Types... > &&__t) noexcept
 
template<typename _T1 , typename _T2 >
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > std::make_pair (_T1 &&__x, _T2 &&__y)
 
template<typename... _Elements>
constexpr tuple< typename __decay_and_strip< _Elements >::__type... > std::make_tuple (_Elements &&... __args)
 
template<typename _Tp >
constexpr std::remove_reference< _Tp >::type && std::move (_Tp &&__t) noexcept
 
template<typename _Tp >
constexpr conditional< __move_if_noexcept_cond< _Tp >::value, const _Tp &, _Tp && >::type std::move_if_noexcept (_Tp &__x) noexcept
 
template<typename _T1 , typename _T2 >
constexpr bool std::operator!= (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename... _TElements, typename... _UElements>
constexpr bool std::operator!= (const tuple< _TElements... > &__t, const tuple< _UElements... > &__u)
 
template<typename _T1 , typename _T2 >
constexpr bool std::operator< (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename... _TElements, typename... _UElements>
constexpr bool std::operator< (const tuple< _TElements... > &__t, const tuple< _UElements... > &__u)
 
template<typename _T1 , typename _T2 >
constexpr bool std::operator<= (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename... _TElements, typename... _UElements>
constexpr bool std::operator<= (const tuple< _TElements... > &__t, const tuple< _UElements... > &__u)
 
template<typename _T1 , typename _T2 >
constexpr bool std::operator== (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename... _TElements, typename... _UElements>
constexpr bool std::operator== (const tuple< _TElements... > &__t, const tuple< _UElements... > &__u)
 
template<typename _T1 , typename _T2 >
constexpr bool std::operator> (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename... _TElements, typename... _UElements>
constexpr bool std::operator> (const tuple< _TElements... > &__t, const tuple< _UElements... > &__u)
 
template<typename _T1 , typename _T2 >
constexpr bool std::operator>= (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename... _TElements, typename... _UElements>
constexpr bool std::operator>= (const tuple< _TElements... > &__t, const tuple< _UElements... > &__u)
 
template<typename _T1 , typename _T2 >
enable_if< __and_< __is_swappable< _T1 >, __is_swappable< _T2 > >::value >::type std::swap (pair< _T1, _T2 > &__x, pair< _T1, _T2 > &__y) noexcept(noexcept(__x.swap(__y)))
 
template<typename... _Elements>
enable_if< __and_< __is_swappable< _Elements >... >::value >::type std::swap (tuple< _Elements... > &__x, tuple< _Elements... > &__y) noexcept(noexcept(__x.swap(__y)))
 
template<typename _Tp >
enable_if< __and_< __not_< __is_tuple_like< _Tp > >, is_move_constructible< _Tp >, is_move_assignable< _Tp > >::value >::type std::swap (_Tp &__a, _Tp &__b) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
 
template<typename _Tp , size_t _Nm>
enable_if< __is_swappable< _Tp >::value >::type std::swap (_Tp(&__a)[_Nm], _Tp(&__b)[_Nm]) noexcept(__is_nothrow_swappable< _Tp >::value)
 
template<typename... _Elements>
constexpr tuple< _Elements &... > std::tie (_Elements &... __args) noexcept
 
template<typename... _Tpls, typename = typename enable_if<__and_<__is_tuple_like<_Tpls>...>::value>::type>
constexpr auto std::tuple_cat (_Tpls &&... __tpls) -> typename __tuple_cat_result< _Tpls... >::__type
 

Variables

_GLIBCXX17_INLINE constexpr _Swallow_assign std::ignore
 
_GLIBCXX17_INLINE constexpr piecewise_construct_t std::piecewise_construct
 

Detailed Description

Components deemed generally useful. Includes pair, tuple, forward/move helpers, ratio, function object, metaprogramming and type traits, time, date, and memory functions.

Function Documentation

◆ __addressof()

◆ __invoke()

template<typename _Callable , typename... _Args>
constexpr __invoke_result<_Callable, _Args...>::type std::__invoke ( _Callable &&  __fn,
_Args &&...  __args 
)
noexcept

Invoke a callable object.

Definition at line 89 of file invoke.h.

◆ addressof()

template<typename _Tp >
_GLIBCXX17_CONSTEXPR _Tp* std::addressof ( _Tp &  __r)
inlinenoexcept

Returns the actual address of the object or function referenced by r, even in the presence of an overloaded operator&.

Parameters
__rReference to an object or function.
Returns
The actual address.

Definition at line 138 of file move.h.

References std::__addressof().

Referenced by std::pointer_traits< _Tp * >::pointer_to().

◆ forward() [1/2]

template<typename _Tp >
constexpr _Tp&& std::forward ( typename std::remove_reference< _Tp >::type &  __t)
noexcept

Forward an lvalue.

Returns
The parameter cast to the specified type.

This function is used to implement "perfect forwarding".

Definition at line 74 of file move.h.

◆ forward() [2/2]

template<typename _Tp >
constexpr _Tp&& std::forward ( typename std::remove_reference< _Tp >::type &&  __t)
noexcept

Forward an rvalue.

Returns
The parameter cast to the specified type.

This function is used to implement "perfect forwarding".

Definition at line 85 of file move.h.

◆ forward_as_tuple()

template<typename... _Elements>
constexpr tuple<_Elements&&...> std::forward_as_tuple ( _Elements &&...  __args)
noexcept

std::forward_as_tuple

Definition at line 1482 of file tuple.

◆ get() [1/8]

template<std::size_t __i, typename... _Elements>
constexpr __tuple_element_t<__i, tuple<_Elements...> >& std::get ( tuple< _Elements... > &  __t)
noexcept

Return a reference to the ith element of a tuple.

Definition at line 1320 of file tuple.

◆ get() [2/8]

template<std::size_t __i, typename... _Elements>
constexpr const __tuple_element_t<__i, tuple<_Elements...> >& std::get ( const tuple< _Elements... > &  __t)
noexcept

Return a const reference to the ith element of a const tuple.

Definition at line 1326 of file tuple.

◆ get() [3/8]

template<std::size_t __i, typename... _Elements>
constexpr __tuple_element_t<__i, tuple<_Elements...> >&& std::get ( tuple< _Elements... > &&  __t)
noexcept

Return an rvalue reference to the ith element of a tuple rvalue.

Definition at line 1332 of file tuple.

◆ get() [4/8]

template<std::size_t __i, typename... _Elements>
constexpr const __tuple_element_t<__i, tuple<_Elements...> >&& std::get ( const tuple< _Elements... > &&  __t)
noexcept

Return a const rvalue reference to the ith element of a const tuple rvalue.

Definition at line 1341 of file tuple.

◆ get() [5/8]

template<typename _Tp , typename... _Types>
constexpr _Tp& std::get ( tuple< _Types... > &  __t)
noexcept

Return a reference to the unique element of type _Tp of a tuple.

Definition at line 1364 of file tuple.

◆ get() [6/8]

template<typename _Tp , typename... _Types>
constexpr _Tp&& std::get ( tuple< _Types... > &&  __t)
noexcept

Return a reference to the unique element of type _Tp of a tuple rvalue.

Definition at line 1370 of file tuple.

◆ get() [7/8]

template<typename _Tp , typename... _Types>
constexpr const _Tp& std::get ( const tuple< _Types... > &  __t)
noexcept

Return a const reference to the unique element of type _Tp of a tuple.

Definition at line 1376 of file tuple.

◆ get() [8/8]

template<typename _Tp , typename... _Types>
constexpr const _Tp&& std::get ( const tuple< _Types... > &&  __t)
noexcept

Return a const reference to the unique element of type _Tp of a const tuple rvalue.

Definition at line 1383 of file tuple.

◆ make_pair()

template<typename _T1 , typename _T2 >
constexpr pair<typename __decay_and_strip<_T1>::__type, typename __decay_and_strip<_T2>::__type> std::make_pair ( _T1 &&  __x,
_T2 &&  __y 
)

A convenience wrapper for creating a pair from two objects.

Parameters
__xThe first object.
__yThe second object.
Returns
A newly-constructed pair<> object of the appropriate type.

The standard requires that the objects be passed by reference-to-const, but LWG issue #181 says they should be passed by const value. We follow the LWG by default.

Definition at line 524 of file stl_pair.h.

Referenced by std::__gen_two_uniform_ints(), __gnu_debug::__get_distance(), __gnu_parallel::__parallel_merge_advance(), __gnu_parallel::__parallel_sort_qsb(), __gnu_debug::__valid_range_aux(), __gnu_parallel::__find_if_selector::_M_sequential_algorithm(), __gnu_parallel::__find_first_of_selector< _FIterator >::_M_sequential_algorithm(), __gnu_parallel::multiseq_selection(), __gnu_parallel::parallel_sort_mwms_pu(), and __gnu_pbds::detail::pat_trie_base::_Node_citer< Node, Leaf, Head, Inode, _CIterator, Iterator, _Alloc >::valid_prefix().

◆ move()

template<typename _Tp >
constexpr std::remove_reference<_Tp>::type&& std::move ( _Tp &&  __t)
noexcept

Convert a value to an rvalue.

Parameters
__tA thing of arbitrary type.
Returns
The parameter cast to an rvalue-reference to allow moving it.

Definition at line 99 of file move.h.

◆ move_if_noexcept()

template<typename _Tp >
constexpr conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type std::move_if_noexcept ( _Tp &  __x)
noexcept

Conditionally convert a value to an rvalue.

Parameters
__xA thing of arbitrary type.
Returns
The parameter, possibly cast to an rvalue-reference.

Same as std::move unless the type's move constructor could throw and the type is copyable, in which case an lvalue-reference is returned instead.

Definition at line 119 of file move.h.

◆ operator!=()

template<typename _T1 , typename _T2 >
constexpr bool std::operator!= ( const pair< _T1, _T2 > &  __x,
const pair< _T1, _T2 > &  __y 
)
inline

Uses operator== to find the result.

Definition at line 461 of file stl_pair.h.

◆ operator<()

template<typename _T1 , typename _T2 >
constexpr bool std::operator< ( const pair< _T1, _T2 > &  __x,
const pair< _T1, _T2 > &  __y 
)
inline

◆ operator<=()

template<typename _T1 , typename _T2 >
constexpr bool std::operator<= ( const pair< _T1, _T2 > &  __x,
const pair< _T1, _T2 > &  __y 
)
inline

Uses operator< to find the result.

Definition at line 473 of file stl_pair.h.

◆ operator==()

template<typename _T1 , typename _T2 >
constexpr bool std::operator== ( const pair< _T1, _T2 > &  __x,
const pair< _T1, _T2 > &  __y 
)
inline

Two pairs of the same type are equal iff their members are equal.

Definition at line 448 of file stl_pair.h.

References std::pair< _T1, _T2 >::first, and std::pair< _T1, _T2 >::second.

◆ operator>()

template<typename _T1 , typename _T2 >
constexpr bool std::operator> ( const pair< _T1, _T2 > &  __x,
const pair< _T1, _T2 > &  __y 
)
inline

Uses operator< to find the result.

Definition at line 467 of file stl_pair.h.

◆ operator>=()

template<typename _T1 , typename _T2 >
constexpr bool std::operator>= ( const pair< _T1, _T2 > &  __x,
const pair< _T1, _T2 > &  __y 
)
inline

Uses operator< to find the result.

Definition at line 479 of file stl_pair.h.

◆ swap() [1/4]

template<typename _T1 , typename _T2 >
enable_if<__and_<__is_swappable<_T1>, __is_swappable<_T2> >::value>::type std::swap ( pair< _T1, _T2 > &  __x,
pair< _T1, _T2 > &  __y 
)
inlinedeletenoexcept

See std::pair::swap().

Definition at line 495 of file stl_pair.h.

◆ swap() [2/4]

template<typename... _Elements>
enable_if<__and_<__is_swappable<_Elements>...>::value >::type std::swap ( tuple< _Elements... > &  __x,
tuple< _Elements... > &  __y 
)
inlinedeletenoexcept

swap

Definition at line 1624 of file tuple.

◆ swap() [3/4]

template<typename _Tp >
enable_if< __and_< __not_< __is_tuple_like< _Tp > >, is_move_constructible< _Tp >, is_move_assignable< _Tp > >::value >::type std::swap ( _Tp &  __a,
_Tp &  __b 
) const
inlinenoexcept

Swaps two values.

Parameters
__aA thing of arbitrary type.
__bAnother thing of arbitrary type.
Returns
Nothing.

Definition at line 182 of file move.h.

◆ swap() [4/4]

template<typename _Tp , size_t _Nm>
enable_if< __is_swappable< _Tp >::value >::type std::swap ( _Tp(&)  __a[_Nm],
_Tp(&)  __b[_Nm] 
)
inlinenoexcept

Swap the contents of two arrays.

Definition at line 205 of file move.h.

◆ tie()

template<typename... _Elements>
constexpr tuple<_Elements&...> std::tie ( _Elements &...  __args)
noexcept

tie

Definition at line 1611 of file tuple.

Referenced by std::basic_ios< char, _Traits >::copyfmt().

◆ tuple_cat()

template<typename... _Tpls, typename = typename enable_if<__and_<__is_tuple_like<_Tpls>...>::value>::type>
constexpr auto std::tuple_cat ( _Tpls &&...  __tpls) -> typename __tuple_cat_result<_Tpls...>::__type

tuple_cat

Definition at line 1597 of file tuple.

Variable Documentation

◆ piecewise_construct

_GLIBCXX17_INLINE constexpr piecewise_construct_t std::piecewise_construct

piecewise_construct

Definition at line 79 of file stl_pair.h.