STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Functions | Variables
utility File Reference
#include <xstddef>
#include <iosfwd>
#include <type_traits>

Classes

struct  piecewise_construct_t
 
class  tuple< _Types >
 
struct  pair< _Ty1, _Ty2 >
 
class  array< _Ty, _Size >
 
struct  tuple_size< _Tuple >
 
struct  tuple_size< array< _Ty, _Size > >
 
struct  tuple_size< pair< _Ty1, _Ty2 > >
 
struct  tuple_size< tuple< _Types...> >
 
struct  tuple_size< const _Tuple >
 
struct  tuple_size< volatile _Tuple >
 
struct  tuple_size< const volatile _Tuple >
 
struct  tuple_element< _Index, _Tuple >
 
struct  tuple_element< _Idx, array< _Ty, _Size > >
 
struct  tuple_element< 0, pair< _Ty1, _Ty2 > >
 
struct  tuple_element< 1, pair< _Ty1, _Ty2 > >
 
struct  tuple_element< _Index, tuple<> >
 
struct  tuple_element< 0, tuple< _This, _Rest...> >
 
struct  tuple_element< _Index, tuple< _This, _Rest...> >
 
struct  tuple_element< _Index, const _Tuple >
 
struct  tuple_element< _Index, volatile _Tuple >
 
struct  tuple_element< _Index, const volatile _Tuple >
 

Namespaces

 rel_ops
 

Macros

#define _UTILITY_
 

Typedefs

template<size_t _Index, class _Tuple >
using tuple_element_t = typename tuple_element< _Index, _Tuple >::type
 

Functions

template<class _Ty >
_STD_BEGIN _Post_equal_to_ (_Right< _Left?_Right:_Left) const expr const _Ty &_Min_value(const _Ty &_Left
 
template<class _Ty >
 _Post_equal_to_ (_Left< _Right?_Right:_Left) const expr const _Ty &_Max_value(const _Ty &_Left
 
template<class _FwdIt1 , class _FwdIt2 >
void iter_swap (_FwdIt1 _Left, _FwdIt2 _Right)
 
template<class _Ty , size_t _Size, class >
void swap (_Ty(&_Left)[_Size], _Ty(&_Right)[_Size]) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
 
template<class _Ty , class >
void swap (_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(is_nothrow_move_constructible< _Ty >
 
template<class _Ty >
void _Swap_adl (_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
 
template<class _Ty1 , class _Ty2 , class = enable_if_t<_Is_swappable<_Ty1>::value && _Is_swappable<_Ty2>::value>>
void swap (pair< _Ty1, _Ty2 > &_Left, pair< _Ty1, _Ty2 > &_Right) _NOEXCEPT_OP(_NOEXCEPT_OP(_Left.swap(_Right)))
 
template<class _Ty1 , class _Ty2 >
constexpr bool operator== (const pair< _Ty1, _Ty2 > &_Left, const pair< _Ty1, _Ty2 > &_Right)
 
template<class _Ty1 , class _Ty2 >
constexpr bool operator!= (const pair< _Ty1, _Ty2 > &_Left, const pair< _Ty1, _Ty2 > &_Right)
 
template<class _Ty1 , class _Ty2 >
constexpr bool operator< (const pair< _Ty1, _Ty2 > &_Left, const pair< _Ty1, _Ty2 > &_Right)
 
template<class _Ty1 , class _Ty2 >
constexpr bool operator> (const pair< _Ty1, _Ty2 > &_Left, const pair< _Ty1, _Ty2 > &_Right)
 
template<class _Ty1 , class _Ty2 >
constexpr bool operator<= (const pair< _Ty1, _Ty2 > &_Left, const pair< _Ty1, _Ty2 > &_Right)
 
template<class _Ty1 , class _Ty2 >
constexpr bool operator>= (const pair< _Ty1, _Ty2 > &_Left, const pair< _Ty1, _Ty2 > &_Right)
 
template<class _Ty1 , class _Ty2 >
constexpr pair< typename _Unrefwrap< _Ty1 >::type, typename _Unrefwrap< _Ty2 >::type > make_pair (_Ty1 &&_Val1, _Ty2 &&_Val2)
 
template<class _Ty >
bool rel_ops::operator!= (const _Ty &_Left, const _Ty &_Right)
 
template<class _Ty >
bool rel_ops::operator> (const _Ty &_Left, const _Ty &_Right)
 
template<class _Ty >
bool rel_ops::operator<= (const _Ty &_Left, const _Ty &_Right)
 
template<class _Ty >
bool rel_ops::operator>= (const _Ty &_Left, const _Ty &_Right)
 
template<class _Ret , class _Pair >
constexpr _Ret _Pair_get (_Pair &_Pr, integral_constant< size_t, 0 >) _NOEXCEPT
 
template<class _Ret , class _Pair >
constexpr _Ret _Pair_get (_Pair &_Pr, integral_constant< size_t, 1 >) _NOEXCEPT
 
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr tuple_element< _Idx, pair< _Ty1, _Ty2 > >::type & get (pair< _Ty1, _Ty2 > &_Pr) _NOEXCEPT
 
template<class _Ty1 , class _Ty2 >
constexpr _Ty1 & get (pair< _Ty1, _Ty2 > &_Pr) _NOEXCEPT
 
template<class _Ty2 , class _Ty1 >
constexpr _Ty2 & get (pair< _Ty1, _Ty2 > &_Pr) _NOEXCEPT
 
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr const tuple_element< _Idx, pair< _Ty1, _Ty2 > >::type & get (const pair< _Ty1, _Ty2 > &_Pr) _NOEXCEPT
 
template<class _Ty1 , class _Ty2 >
constexpr const _Ty1 & get (const pair< _Ty1, _Ty2 > &_Pr) _NOEXCEPT
 
template<class _Ty2 , class _Ty1 >
constexpr const _Ty2 & get (const pair< _Ty1, _Ty2 > &_Pr) _NOEXCEPT
 
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr tuple_element< _Idx, pair< _Ty1, _Ty2 > >::type && get (pair< _Ty1, _Ty2 > &&_Pr) _NOEXCEPT
 
template<class _Ty1 , class _Ty2 >
constexpr _Ty1 && get (pair< _Ty1, _Ty2 > &&_Pr) _NOEXCEPT
 
template<class _Ty2 , class _Ty1 >
constexpr _Ty2 && get (pair< _Ty1, _Ty2 > &&_Pr) _NOEXCEPT
 
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr const tuple_element< _Idx, pair< _Ty1, _Ty2 > >::type && get (const pair< _Ty1, _Ty2 > &&_Pr) _NOEXCEPT
 
template<class _Ty1 , class _Ty2 >
constexpr const _Ty1 && get (const pair< _Ty1, _Ty2 > &&_Pr) _NOEXCEPT
 
template<class _Ty2 , class _Ty1 >
constexpr const _Ty2 && get (const pair< _Ty1, _Ty2 > &&_Pr) _NOEXCEPT
 
template<class _Ty , class _Other = _Ty>
_Ty exchange (_Ty &_Val, _Other &&_New_val)
 
template<class _Ty >
constexpr add_const_t< _Ty > & as_const (_Ty &_Val) _NOEXCEPT
 
template<class _Ty >
void as_const (const _Ty &&)=delete
 

Variables

_STD_BEGIN const _Ty & _Right
 
constexpr piecewise_construct_t piecewise_construct {}
 
template<class _Ty >
constexpr size_t tuple_size_v = tuple_size<_Ty>::value
 

Macro Definition Documentation

#define _UTILITY_

Typedef Documentation

template<size_t _Index, class _Tuple >
using tuple_element_t = typename tuple_element<_Index, _Tuple>::type

Function Documentation

template<class _Ret , class _Pair >
constexpr _Ret _Pair_get ( _Pair &  _Pr,
integral_constant< size_t, 0 >   
)
inline
517  { // get reference to element 0 in pair _Pr
518  return (_Pr.first);
519  }
template<class _Ret , class _Pair >
constexpr _Ret _Pair_get ( _Pair &  _Pr,
integral_constant< size_t, 1 >   
)
inline
525  { // get reference to element 1 in pair _Pr
526  return (_Pr.second);
527  }
template<class _Ty >
_STD_BEGIN _Post_equal_to_ ( ) const
template<class _Ty >
_Post_equal_to_ ( ) const
template<class _Ty >
void _Swap_adl ( _Ty &  _Left,
_Ty &  _Right 
)
inline
75  { // exchange values stored at _Left and _Right, using ADL
76  swap(_Left, _Right);
77  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
void swap(_Ty(&_Left)[_Size], _Ty(&_Right)[_Size]) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:47
_STD_BEGIN const _Ty & _Right
Definition: utility:22
template<class _Ty >
constexpr add_const_t<_Ty>& as_const ( _Ty &  _Val)
inline
639  { // view _Val through const lenses
640  return (_Val);
641  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty >
void as_const ( const _Ty &&  )
delete
template<class _Ty , class _Other = _Ty>
_Ty exchange ( _Ty &  _Val,
_Other &&  _New_val 
)
inline
630  { // assign _New_val to _Val, return previous _Val
631  _Ty _Old_val = _STD move(_Val);
632  _Val = _STD forward<_Other>(_New_val);
633  return (_Old_val);
634  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr tuple_element<_Idx, pair<_Ty1, _Ty2> >::type& get ( pair< _Ty1, _Ty2 > &  _Pr)
inline
534  { // get reference to element at _Idx in pair _Pr
535  typedef typename tuple_element<_Idx, pair<_Ty1, _Ty2> >::type& _Rtype;
536  return (_Pair_get<_Rtype>(_Pr, integral_constant<size_t, _Idx>()));
537  }
Definition: xtr1common:23
Definition: utility:431
template<class _Ty1 , class _Ty2 >
constexpr _Ty1& get ( pair< _Ty1, _Ty2 > &  _Pr)
inline
542  { // get reference to element _Ty1 in pair _Pr
543  return (_STD get<0>(_Pr));
544  }
template<class _Ty2 , class _Ty1 >
constexpr _Ty2& get ( pair< _Ty1, _Ty2 > &  _Pr)
inline
549  { // get reference to element _Ty2 in pair _Pr
550  return (_STD get<1>(_Pr));
551  }
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr const tuple_element<_Idx, pair<_Ty1, _Ty2> >::type& get ( const pair< _Ty1, _Ty2 > &  _Pr)
inline
558  { // get const reference to element at _Idx in pair _Pr
559  typedef const typename tuple_element<_Idx, pair<_Ty1, _Ty2> >::type&
560  _Ctype;
561  return (_Pair_get<_Ctype>(_Pr, integral_constant<size_t, _Idx>()));
562  }
Definition: xtr1common:23
Definition: utility:431
template<class _Ty1 , class _Ty2 >
constexpr const _Ty1& get ( const pair< _Ty1, _Ty2 > &  _Pr)
inline
567  { // get const reference to element _Ty1 in pair _Pr
568  return (_STD get<0>(_Pr));
569  }
template<class _Ty2 , class _Ty1 >
constexpr const _Ty2& get ( const pair< _Ty1, _Ty2 > &  _Pr)
inline
574  { // get const reference to element _Ty2 in pair _Pr
575  return (_STD get<1>(_Pr));
576  }
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr tuple_element<_Idx, pair<_Ty1, _Ty2> >::type&& get ( pair< _Ty1, _Ty2 > &&  _Pr)
inline
583  { // get rvalue reference to element at _Idx in pair _Pr
584  typedef typename tuple_element<_Idx, pair<_Ty1, _Ty2> >::type&& _RRtype;
585  return (_STD forward<_RRtype>(_STD get<_Idx>(_Pr)));
586  }
Definition: utility:431
template<class _Ty1 , class _Ty2 >
constexpr _Ty1&& get ( pair< _Ty1, _Ty2 > &&  _Pr)
inline
591  { // get rvalue reference to element _Ty1 in pair _Pr
592  return (_STD get<0>(_STD move(_Pr)));
593  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Ty2 , class _Ty1 >
constexpr _Ty2&& get ( pair< _Ty1, _Ty2 > &&  _Pr)
inline
598  { // get rvalue reference to element _Ty2 in pair _Pr
599  return (_STD get<1>(_STD move(_Pr)));
600  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<size_t _Idx, class _Ty1 , class _Ty2 >
constexpr const tuple_element<_Idx, pair<_Ty1, _Ty2> >::type&& get ( const pair< _Ty1, _Ty2 > &&  _Pr)
inline
607  { // get const rvalue reference to element at _Idx in pair _Pr
608  typedef const typename tuple_element<_Idx, pair<_Ty1, _Ty2> >::type&& _RRtype;
609  return (_STD forward<_RRtype>(_STD get<_Idx>(_Pr)));
610  }
Definition: utility:431
template<class _Ty1 , class _Ty2 >
constexpr const _Ty1&& get ( const pair< _Ty1, _Ty2 > &&  _Pr)
inline
615  { // get const rvalue reference to element _Ty1 in pair _Pr
616  return (_STD get<0>(_STD move(_Pr)));
617  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Ty2 , class _Ty1 >
constexpr const _Ty2&& get ( const pair< _Ty1, _Ty2 > &&  _Pr)
inline
622  { // get const rvalue reference to element _Ty2 in pair _Pr
623  return (_STD get<1>(_STD move(_Pr)));
624  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _FwdIt1 , class _FwdIt2 >
void iter_swap ( _FwdIt1  _Left,
_FwdIt2  _Right 
)
inline
39  { // swap *_Left and *_Right
40  swap(*_Left, *_Right);
41  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
void swap(_Ty(&_Left)[_Size], _Ty(&_Right)[_Size]) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:47
_STD_BEGIN const _Ty & _Right
Definition: utility:22
template<class _Ty1 , class _Ty2 >
constexpr pair<typename _Unrefwrap<_Ty1>::type, typename _Unrefwrap<_Ty2>::type> make_pair ( _Ty1 &&  _Val1,
_Ty2 &&  _Val2 
)
inline
341  { // return pair composed from arguments
343  typename _Unrefwrap<_Ty2>::type> _Mypair;
344  return (_Mypair(_STD forward<_Ty1>(_Val1),
345  _STD forward<_Ty2>(_Val2)));
346  }
Definition: utility:92
_Unrefwrap_helper< _Ty1 >::type type
Definition: type_traits:1890
template<class _Ty1 , class _Ty2 >
constexpr bool operator!= ( const pair< _Ty1, _Ty2 > &  _Left,
const pair< _Ty1, _Ty2 > &  _Right 
)
inline
297  { // test for pair inequality
298  return (!(_Left == _Right));
299  }
template<class _Ty1 , class _Ty2 >
constexpr bool operator< ( const pair< _Ty1, _Ty2 > &  _Left,
const pair< _Ty1, _Ty2 > &  _Right 
)
inline
305  { // test if _Left < _Right for pairs
306  return (_Left.first < _Right.first ||
307  (!(_Right.first < _Left.first) && _Left.second < _Right.second));
308  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1 , class _Ty2 >
constexpr bool operator<= ( const pair< _Ty1, _Ty2 > &  _Left,
const pair< _Ty1, _Ty2 > &  _Right 
)
inline
322  { // test if _Left <= _Right for pairs
323  return (!(_Right < _Left));
324  }
template<class _Ty1 , class _Ty2 >
constexpr bool operator== ( const pair< _Ty1, _Ty2 > &  _Left,
const pair< _Ty1, _Ty2 > &  _Right 
)
inline
289  { // test for pair equality
290  return (_Left.first == _Right.first && _Left.second == _Right.second);
291  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1 , class _Ty2 >
constexpr bool operator> ( const pair< _Ty1, _Ty2 > &  _Left,
const pair< _Ty1, _Ty2 > &  _Right 
)
inline
314  { // test if _Left > _Right for pairs
315  return (_Right < _Left);
316  }
template<class _Ty1 , class _Ty2 >
constexpr bool operator>= ( const pair< _Ty1, _Ty2 > &  _Left,
const pair< _Ty1, _Ty2 > &  _Right 
)
inline
330  { // test if _Left >= _Right for pairs
331  return (!(_Left < _Right));
332  }
template<class _Ty , size_t _Size, class >
void swap ( _Ty(&)  _Left[_Size],
_Ty(&)  _Right[_Size] 
)
inline
49  { // exchange arrays stored at _Left and _Right
50  if (&_Left != &_Right)
51  { // worth swapping, swap ranges
52  _Ty *_First1 = _Left;
53  _Ty *_Last1 = _First1 + _Size;
54  _Ty *_First2 = _Right;
55  for (; _First1 != _Last1; ++_First1, ++_First2)
56  _STD iter_swap(_First1, _First2);
57  }
58  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
void iter_swap(_FwdIt1 _Left, _FwdIt2 _Right)
Definition: utility:38
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_STD_BEGIN const _Ty & _Right
Definition: utility:22
template<class _Ty , class >
void swap ( _Ty &  _Left,
_Ty &  _Right 
)
inline
65  { // exchange values stored at _Left and _Right
66  _Ty _Tmp = _STD move(_Left);
67  _Left = _STD move(_Right);
68  _Right = _STD move(_Tmp);
69  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_STD_BEGIN const _Ty & _Right
Definition: utility:22
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Ty1 , class _Ty2 , class = enable_if_t<_Is_swappable<_Ty1>::value && _Is_swappable<_Ty2>::value>>
void swap ( pair< _Ty1, _Ty2 > &  _Left,
pair< _Ty1, _Ty2 > &  _Right 
)
inline
281  { // swap _Left and _Right pairs
282  _Left.swap(_Right);
283  }
void swap(_Myt &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty1 >
Definition: utility:259

Variable Documentation

const _Ty& _Right
Initial value:
{
return (_Right < _Left ? _Right : _Left)
constexpr const _Ty &() _Left
Definition: algorithm:3722
_STD_BEGIN const _Ty & _Right
Definition: utility:22
constexpr piecewise_construct_t piecewise_construct {}
template<class _Ty >
constexpr size_t tuple_size_v = tuple_size<_Ty>::value