STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Enumerations | Functions | Variables
functional File Reference
#include <xfunctional>
#include <exception>
#include <typeinfo>
#include <tuple>

Classes

class  _Mem_fn< _Memptr >
 
class  bad_function_call
 
class  function< _Fty >
 
class  _Func_base< _Rx, _Types >
 
union  _Storage
 
struct  _Get_function_impl< _Tx >
 
class  function< _Fty >
 
struct  _Ph< _Nx >
 
struct  is_placeholder< _Tx >
 
struct  is_placeholder< _Ph< _Nx > >
 
struct  is_placeholder< const _Tx >
 
struct  is_placeholder< volatile _Tx >
 
struct  is_placeholder< const volatile _Tx >
 
class  _Binder< _Ret, _Fx, _Types >
 
struct  is_bind_expression< _Tx >
 
struct  is_bind_expression< _Binder< _Ret, _Fx, _Types...> >
 
struct  is_bind_expression< const _Tx >
 
struct  is_bind_expression< volatile _Tx >
 
struct  is_bind_expression< const volatile _Tx >
 
struct  _Select_fixer< _Cv_TiD, bool, bool, int >
 
struct  _Select_fixer< _Cv_TiD, true, false, 0 >
 
struct  _Select_fixer< _Cv_TiD, false, true, 0 >
 
struct  _Select_fixer< _Cv_TiD, false, false, 0 >
 
struct  _Select_fixer< _Cv_TiD, false, false, _Jx >
 
struct  _Forced_result_type< _Ret >
 
struct  _Binder_result_type< _Ret, _Fx >
 
class  _Binder< _Ret, _Fx, _Types >
 
struct  std::uses_allocator< function< _Fty >, _Alloc >
 

Namespaces

 placeholders
 

Macros

#define _FUNCTIONAL_
 
#define _GET_FUNCTION_IMPL(CALL_OPT, X1, X2)
 
#define _BINDER_OPERATOR(CONST_OPT)
 

Enumerations

enum  { _EEN_IMPL = _Num_ptrs - 1 }
 

Functions

template<class _Rx , class _Ty >
_Mem_fn< _Rx _Ty::* > mem_fn (_Rx _Ty::*_Pm) _NOEXCEPT
 
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_function_call ()
 
template<class _Ty >
bool _Test_callable (const _Ty &_Arg, true_type) _NOEXCEPT
 
template<class _Ty >
bool _Test_callable (const _Ty &, false_type) _NOEXCEPT
 
template<class _Ty >
bool _Test_callable (const _Ty &_Arg) _NOEXCEPT
 
template<class _Fty >
bool _Test_callable (const function< _Fty > &_Arg) _NOEXCEPT
 
template<class _Impl >
 _Set (0)
 
void _Swap (_Myt &_Right) _NOEXCEPT
 
const _XSTD2 type_info_Target_type () const _NOEXCEPT
 
const void_Target (const _XSTD2 type_info &_Info) const _NOEXCEPT
 
bool _Local () const _NOEXCEPT
 
_Ptrt * _Getimpl () const _NOEXCEPT
 
void _Set (_Ptrt *_Ptr) _NOEXCEPT
 
void_Getspace () _NOEXCEPT
 
template<class _Fty >
void swap (function< _Fty > &_Left, function< _Fty > &_Right) _NOEXCEPT
 
template<class _Fty >
bool operator== (const function< _Fty > &_Other, nullptr_t) _NOEXCEPT
 
template<class _Fty >
bool operator== (nullptr_t, const function< _Fty > &_Other) _NOEXCEPT
 
template<class _Fty >
bool operator!= (const function< _Fty > &_Other, nullptr_t) _NOEXCEPT
 
template<class _Fty >
bool operator!= (nullptr_t, const function< _Fty > &_Other) _NOEXCEPT
 
template<class _Cv_TiD , class _Untuple >
auto _Fix_arg (_Cv_TiD &_Tid, _Untuple &&_Ut) -> decltype(_Select_fixer< _Cv_TiD >::_Fix(_Tid, _STD move(_Ut)))
 
template<class _Ret , size_t... _Ix, class _Cv_FD , class _Cv_tuple_TiD , class _Untuple >
auto _Call_binder (_Forced< _Ret > _Fr, integer_sequence< size_t, _Ix...>, _Cv_FD &_Obj, _Cv_tuple_TiD &_Tpl, _Untuple &&_Ut) -> decltype(_Invoke_ret(_Fr, _Obj, _Fix_arg(_STD get< _Ix >(_Tpl), _STD move(_Ut))...))
 
template<class _Fx , class... _Types>
_Binder< _Unforced, _Fx, _Types...> bind (_Fx &&_Func, _Types &&..._Args)
 
template<class _Ret , class _Fx , class... _Types>
_Binder< _Ret, _Fx, _Types...> bind (_Fx &&_Func, _Types &&..._Args)
 

Variables

const int _Num_ptrs = 6 + 16 / sizeof (void *)
 
const size_t _Space_size = (_Num_ptrs - 1) * sizeof (void *)
 
_Storage _Mystorage
 
constexpr _Ph< 1 > placeholders::_1
 
constexpr _Ph< 2 > placeholders::_2 {}
 
constexpr _Ph< 3 > placeholders::_3 {}
 
constexpr _Ph< 4 > placeholders::_4 {}
 
constexpr _Ph< 5 > placeholders::_5 {}
 
constexpr _Ph< 6 > placeholders::_6 {}
 
constexpr _Ph< 7 > placeholders::_7 {}
 
constexpr _Ph< 8 > placeholders::_8 {}
 
constexpr _Ph< 9 > placeholders::_9 {}
 
constexpr _Ph< 10 > placeholders::_10 {}
 
constexpr _Ph< 11 > placeholders::_11 {}
 
constexpr _Ph< 12 > placeholders::_12 {}
 
constexpr _Ph< 13 > placeholders::_13 {}
 
constexpr _Ph< 14 > placeholders::_14 {}
 
constexpr _Ph< 15 > placeholders::_15 {}
 
constexpr _Ph< 16 > placeholders::_16 {}
 
constexpr _Ph< 17 > placeholders::_17 {}
 
constexpr _Ph< 18 > placeholders::_18 {}
 
constexpr _Ph< 19 > placeholders::_19 {}
 
constexpr _Ph< 20 > placeholders::_20 {}
 

Macro Definition Documentation

#define _BINDER_OPERATOR (   CONST_OPT)
Value:
template<class... _Unbound> \
auto operator()(_Unbound&&... _Unbargs) CONST_OPT \
-> decltype(_Call_binder(_Forced<_Ret>(), _Seq(), \
_Mypair._Get_first(), _Mypair._Get_second(), \
_STD forward_as_tuple(_STD forward<_Unbound>(_Unbargs)...))) \
{ /* invoke bound callable object with bound/unbound arguments */ \
_Mypair._Get_first(), _Mypair._Get_second(), \
_STD forward_as_tuple(_STD forward<_Unbound>(_Unbargs)...))); \
}
constexpr tuple< _Types &&...> forward_as_tuple(_Types &&..._Args) _NOEXCEPT
Definition: tuple:985
auto _Call_binder(_Forced< _Ret > _Fr, integer_sequence< size_t, _Ix...>, _Cv_FD &_Obj, _Cv_tuple_TiD &_Tpl, _Untuple &&_Ut) -> decltype(_Invoke_ret(_Fr, _Obj, _Fix_arg(_STD get< _Ix >(_Tpl), _STD move(_Ut))...))
Definition: functional:818
#define _STD
Definition: yvals.h:566
Definition: type_traits:1449
constexpr _Ty && forward(typename remove_reference< _Ty >::type &_Arg) _NOEXCEPT
Definition: type_traits:1273
return(_PAIR_TYPE(_FwdIt)(_First, _First))
#define _FUNCTIONAL_
#define _GET_FUNCTION_IMPL (   CALL_OPT,
  X1,
  X2 
)
Value:
template<class _Ret, \
class... _Types> \
struct _Get_function_impl<_Ret CALL_OPT (_Types...)> \
{ /* determine type from argument list */ \
typedef _Func_class<_Ret, _Types...> type; \
};
Definition: functional:456

Enumeration Type Documentation

anonymous enum
private
Enumerator
_EEN_IMPL 
432 {_EEN_IMPL = _Num_ptrs - 1}; // helper for expression evaluator
Definition: functional:432
const int _Num_ptrs
Definition: functional:131

Function Documentation

template<class _Ret , size_t... _Ix, class _Cv_FD , class _Cv_tuple_TiD , class _Untuple >
auto _Call_binder ( _Forced< _Ret >  _Fr,
integer_sequence< size_t, _Ix...>  ,
_Cv_FD &  _Obj,
_Cv_tuple_TiD &  _Tpl,
_Untuple &&  _Ut 
) -> decltype(_Invoke_ret(_Fr, _Obj, _Fix_arg( _STD get<_Ix>(_Tpl), _STD move(_Ut))...))
inlineprivate
822  { // bind() and bind<R>() invocation
823  (void) _Tpl; // TRANSITION, VSO#181496
824  (void) _Ut;
825  return (_Invoke_ret(_Fr, _Obj, _Fix_arg(
826  _STD get<_Ix>(_Tpl), _STD move(_Ut))...));
827  }
auto _Fix_arg(_Cv_TiD &_Tid, _Untuple &&_Ut) -> decltype(_Select_fixer< _Cv_TiD >::_Fix(_Tid, _STD move(_Ut)))
Definition: functional:806
void _Invoke_ret(_Forced< _Cv_void, true >, _Valtys &&..._Vals)
Definition: type_traits:1459
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
template<class _Cv_TiD , class _Untuple >
auto _Fix_arg ( _Cv_TiD &  _Tid,
_Untuple &&  _Ut 
) -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))
inlineprivate
808  { // translate an argument for bind
809  return (_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)));
810  }
Definition: functional:745
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Ptrt* _Getimpl ( ) const
private
434  { // get pointer to object
435  return (_Mystorage._Ptrs[_Num_ptrs - 1]);
436  }
_Storage _Mystorage
Definition: functional:431
const int _Num_ptrs
Definition: functional:131
_Ptrt * _Ptrs[_Num_ptrs]
Definition: functional:428
const void * _Getspace ( )
private
444  { // get pointer to storage space
445  return (&_Mystorage);
446  }
_Storage _Mystorage
Definition: functional:431
bool _Local ( ) const
private
420  { // test for locally stored copy of object
421  return (_Getimpl() == _Getspace());
422  }
_Ptrt * _Getimpl() const _NOEXCEPT
Definition: functional:433
void * _Getspace() _NOEXCEPT
Definition: functional:443
template<class _Impl >
_Set ( )
void _Set ( _Ptrt *  _Ptr)
private
439  { // store pointer to object
440  _Mystorage._Ptrs[_Num_ptrs - 1] = _Ptr;
441  }
_Storage _Mystorage
Definition: functional:431
const int _Num_ptrs
Definition: functional:131
_Ptrt * _Ptrs[_Num_ptrs]
Definition: functional:428
void _Swap ( _Myt &  _Right)
392  { // swap contents with contents of _Right
393  if (!_Local() && !_Right._Local())
394  { // just swap pointers
395  _Ptrt *_Temp = _Getimpl();
396  _Set(_Right._Getimpl());
397  _Right._Set(_Temp);
398  }
399  else
400  { // do three-way move
401  _Myt _Temp;
402  _Temp._Reset_move(_STD move(*this));
403  _Reset_move(_STD move(_Right));
404  _Right._Reset_move(_STD move(_Temp));
405  }
406  }
_Ptrt * _Getimpl() const _NOEXCEPT
Definition: functional:433
bool _Local() const _NOEXCEPT
Definition: functional:419
_Set(0)
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591
const void* _Target ( const _XSTD2 type_info _Info) const
414  { // return pointer to stored object
415  return (_Getimpl() ? _Getimpl()->_Target(_Info) : 0);
416  }
_Ptrt * _Getimpl() const _NOEXCEPT
Definition: functional:433
const void * _Target(const _XSTD2 type_info &_Info) const _NOEXCEPT
Definition: functional:413
const _XSTD2 type_info& _Target_type ( ) const
409  { // return type information for stored object
410  return (_Getimpl() ? _Getimpl()->_Target_type() : typeid(void));
411  }
_Ptrt * _Getimpl() const _NOEXCEPT
Definition: functional:433
const _XSTD2 type_info & _Target_type() const _NOEXCEPT
Definition: functional:408
template<class _Ty >
bool _Test_callable ( const _Ty &  _Arg,
true_type   
)
inline
71  { // std::function must store non-null testable callable objects
72  return (!!_Arg);
73  }
template<class _Ty >
bool _Test_callable ( const _Ty &  ,
false_type   
)
inline
77  { // std::function must store arbitrary callable objects
78  return (true);
79  }
template<class _Ty >
bool _Test_callable ( const _Ty &  _Arg)
inline
83  { // determine whether std::function must store _Arg
86  return (_Test_callable(_Arg, _Testable));
87  }
Definition: xstddef:690
Definition: xtr1common:49
bool _Test_callable(const _Ty &_Arg, true_type) _NOEXCEPT
Definition: functional:70
Definition: type_traits:298
template<class _Fty >
bool _Test_callable ( const function< _Fty > &  _Arg)
inline
91  { // determine whether std::function must store _Arg
92  return (!!_Arg);
93  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_function_call ( )
template<class _Fx , class... _Types>
_Binder<_Unforced, _Fx, _Types...> bind ( _Fx &&  _Func,
_Types &&...  _Args 
)
inlineprivate
889  { // bind a callable object with an implicit return type
891  _STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...));
892  }
Definition: functional:700
template<class _Ret , class _Fx , class... _Types>
_Binder<_Ret, _Fx, _Types...> bind ( _Fx &&  _Func,
_Types &&...  _Args 
)
inlineprivate
899  { // bind a callable object with an explicit return type
901  _STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...));
902  }
Definition: functional:700
template<class _Rx , class _Ty >
_Mem_fn<_Rx _Ty::*> mem_fn ( _Rx _Ty::*  _Pm)
inline
42  { // wrap a pointer to member function/data
43  return (_Mem_fn<_Rx _Ty::*>(_Pm));
44  }
Definition: functional:19
template<class _Fty >
bool operator!= ( const function< _Fty > &  _Other,
nullptr_t   
)
inlineprivate
643  { // compare to null pointer
644  return (static_cast<bool>(_Other));
645  }
template<class _Fty >
bool operator!= ( nullptr_t  ,
const function< _Fty > &  _Other 
)
inlineprivate
650  { // compare to null pointer
651  return (static_cast<bool>(_Other));
652  }
template<class _Fty >
bool operator== ( const function< _Fty > &  _Other,
nullptr_t   
)
inlineprivate
629  { // compare to null pointer
630  return (!_Other);
631  }
template<class _Fty >
bool operator== ( nullptr_t  ,
const function< _Fty > &  _Other 
)
inlineprivate
636  { // compare to null pointer
637  return (!_Other);
638  }
template<class _Fty >
void swap ( function< _Fty > &  _Left,
function< _Fty > &  _Right 
)
inlineprivate
621  { // swap contents of _Left with contents of _Right
622  _Left.swap(_Right);
623  }
void swap(_Myt &_Right) _NOEXCEPT
Definition: functional:589

Variable Documentation

_Storage _Mystorage
const int _Num_ptrs = 6 + 16 / sizeof (void *)
const size_t _Space_size = (_Num_ptrs - 1) * sizeof (void *)