STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Types | List of all members
function< _Fty > Class Template Reference
Inheritance diagram for function< _Fty >:

Public Types

typedef function< _Fty > _Myt
 

Public Member Functions

 function () _NOEXCEPT
 
 function (nullptr_t) _NOEXCEPT
 
 function (const _Myt &_Right)
 
template<class _Fx , class = typename _Mybase::template _Enable_if_callable_t<_Fx&>>
 function (_Fx _Func)
 
template<class _Alloc >
 function (allocator_arg_t, const _Alloc &) _NOEXCEPT
 
template<class _Alloc >
 function (allocator_arg_t, const _Alloc &, nullptr_t) _NOEXCEPT
 
template<class _Alloc >
 function (allocator_arg_t, const _Alloc &_Ax, const _Myt &_Right)
 
template<class _Fx , class _Alloc , class = typename _Mybase::template _Enable_if_callable_t<_Fx&>>
 function (allocator_arg_t, const _Alloc &_Ax, _Fx _Func)
 
 ~function () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
 function (_Myt &&_Right)
 
template<class _Alloc >
 function (allocator_arg_t, const _Alloc &_Al, _Myt &&_Right)
 
_Mytoperator= (_Myt &&_Right)
 
template<class _Fx , class = typename _Mybase::template _Enable_if_callable_t<decay_t<_Fx>&>>
_Mytoperator= (_Fx &&_Func)
 
_Mytoperator= (nullptr_t) _NOEXCEPT
 
template<class _Fx >
_Mytoperator= (reference_wrapper< _Fx > _Func) _NOEXCEPT
 
void swap (_Myt &_Right) _NOEXCEPT
 
 operator bool () const _NOEXCEPT
 
const type_infotarget_type () const _NOEXCEPT
 
template<class _Fx >
_Fx * target () _NOEXCEPT
 
template<class _Fx >
const _Fx * target () const _NOEXCEPT
 

Private Types

typedef _Get_function_impl< _Fty >::type _Mybase
 

Member Typedef Documentation

template<class _Fty>
typedef _Get_function_impl<_Fty>::type function< _Fty >::_Mybase
private
template<class _Fty>
typedef function<_Fty> function< _Fty >::_Myt

Constructor & Destructor Documentation

template<class _Fty>
function< _Fty >::function ( )
inline
476  { // construct empty function wrapper
477  }
template<class _Fty>
function< _Fty >::function ( nullptr_t  )
inline
480  { // construct empty function wrapper from null pointer
481  }
template<class _Fty>
function< _Fty >::function ( const _Myt _Right)
inline
484  { // construct holding copy of _Right
485  this->_Reset_copy(_Right);
486  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Fty>
template<class _Fx , class = typename _Mybase::template _Enable_if_callable_t<_Fx&>>
function< _Fty >::function ( _Fx  _Func)
inline
491  { // construct wrapper holding copy of _Func
492  this->_Reset(_STD move(_Func));
493  }
struct _Meta_at_< _Meta_list< _Types...>, _Idx, enable_if_t<(_Idx< sizeof...(_Types))> >:decltype(_Meta_at_impl< _Meta_repeat_n_c< _Idx, void * >>::_Eval(_Type_as_pointer< _Types >()...)){};template< class _List, class _Ty > struct _Meta_find_index_{};template< class _List, class _Ty > using _Meta_find_index=typename _Meta_find_index_< _List, _Ty >::type;constexpr auto _Meta_npos=static_cast< size_t >(-1);constexpr size_t _Meta_find_index_i_(bool const *const _Ptr, const size_t _Count, const size_t _Idx=0){return(_Idx >=_Count?_Meta_npos:_Ptr[_Idx]?_Idx:_Meta_find_index_i_(_Ptr, _Count, _Idx+1));}template< class _Ty > struct _Meta_find_index_< _Meta_list<>, _Ty >:integral_constant< size_t, _Meta_npos >{};template< class..._Types, class _Ty > struct _Meta_find_index_< _Meta_list< _Types...>, _Ty >{static constexpr bool _Bools[]={is_same< _Types, _Ty >::value...};using type=integral_constant< size_t, _Meta_find_index_i_(_Bools, sizeof...(_Types))>;};template< class _List, class _Ty > struct _Meta_find_unique_index_{};template< class _List, class _Ty > using _Meta_find_unique_index=typename _Meta_find_unique_index_< _List, _Ty >::type;constexpr size_t _Meta_find_unique_index_i_2(bool const *const _Ptr, const size_t _Count, const size_t _First){return(_First!=_Meta_npos &&_Meta_find_index_i_(_Ptr, _Count, _First+1)==_Meta_npos?_First:_Meta_npos);}constexpr size_t _Meta_find_unique_index_i_(bool const *const _Ptr, const size_t _Count){return(_Meta_find_unique_index_i_2(_Ptr, _Count, _Meta_find_index_i_(_Ptr, _Count)));}template< class _Ty > struct _Meta_find_unique_index_< _Meta_list<>, _Ty >:integral_constant< size_t, _Meta_npos >{};template< class..._Types, class _Ty > struct _Meta_find_unique_index_< _Meta_list< _Types...>, _Ty >{using type=integral_constant< size_t, _Meta_find_unique_index_i_(_Meta_find_index_< _Meta_list< _Types...>, _Ty >::_Bools, sizeof...(_Types))>;};template< class > struct _Meta_as_list_{};template< class _Ty > using _Meta_as_list=typename _Meta_as_list_< _Ty >::type;template< template< class > class _Template, class..._Types > struct _Meta_as_list_< _Template< _Types...> >{using type=_Meta_list< _Types...>;};template< class _Ty, _Ty..._Idxs > struct _Meta_as_list_< integer_sequence< _Ty, _Idxs...> >{using type=_Meta_list< integral_constant< _Ty, _Idxs >...>;};template< class _List > struct _Meta_as_integer_sequence_{};template< class _List > using _Meta_as_integer_sequence=typename _Meta_as_integer_sequence_< _List >::type;template< class _Ty, _Ty..._Idxs > struct _Meta_as_integer_sequence_< _Meta_list< integral_constant< _Ty, _Idxs >...> >{using type=integer_sequence< _Ty, _Idxs...>;};template< class...> struct _Meta_concat_{};template< class..._Types > using _Meta_concat=typename _Meta_concat_< _Types...>::type;template<> struct _Meta_concat_< _Meta_list<> >{using type=_Meta_list<>;};template< class..._Items1 > struct _Meta_concat_< _Meta_list< _Items1...> >{using type=_Meta_list< _Items1...>;};template< class..._Items1, class..._Items2 > struct _Meta_concat_< _Meta_list< _Items1...>, _Meta_list< _Items2...> >{using type=_Meta_list< _Items1..., _Items2...>;};template< class..._Items1, class..._Items2, class..._Items3 > struct _Meta_concat_< _Meta_list< _Items1...>, _Meta_list< _Items2...>, _Meta_list< _Items3...> >{using type=_Meta_list< _Items1..., _Items2..., _Items3...>;};template< class..._Items1, class..._Items2, class..._Items3, class..._Rest > struct _Meta_concat_< _Meta_list< _Items1...>, _Meta_list< _Items2...>, _Meta_list< _Items3...>, _Rest...>{using type=_Meta_concat< _Meta_list< _Items1..., _Items2..., _Items3...>, _Rest...>;};template< class _ListOfLists > using _Meta_join=_Meta_apply< _Meta_quote< _Meta_concat >, _ListOfLists >;template< class > struct _Meta_cartesian_product_{};template< class _ListOfLists > using _Meta_cartesian_product=typename _Meta_cartesian_product_< _ListOfLists >::type;template<> struct _Meta_cartesian_product_< _Meta_list<> >{using type=_Meta_list<>;};template< class..._Items > struct _Meta_cartesian_product_< _Meta_list< _Meta_list< _Items...> > >{using type=_Meta_list< _Meta_list< _Items >...>;};template< class..._Items, class..._Lists > struct _Meta_cartesian_product_< _Meta_list< _Meta_list< _Items...>, _Lists...> >{using type=_Meta_join< _Meta_list< _Meta_transform< _Meta_bind_back< _Meta_quote< _Meta_push_front >, _Items >, _Meta_cartesian_product< _Meta_list< _Lists...> > >...> >;};template< class..._Types > class variant;template< class _Ty > struct variant_size;template< class _Ty > struct variant_size< const _Ty >:variant_size< _Ty >::type{};template< class _Ty > struct variant_size< volatile _Ty >:variant_size< _Ty >::type{};template< class _Ty > struct variant_size< const volatile _Ty >:variant_size< _Ty >::type{};template< class _Ty > constexpr size_t variant_size_v=variant_size< _Ty >::value;template< class..._Types > struct variant_size< variant< _Types...> >:integral_constant< size_t, sizeof...(_Types)>{};template< size_t _Idx, class _Ty > struct variant_alternative;template< size_t _Idx, class _Ty > using variant_alternative_t=typename variant_alternative< _Idx, _Ty >::type;template< size_t _Idx, class _Ty > struct variant_alternative< _Idx, const _Ty >{using type=add_const_t< variant_alternative_t< _Idx, _Ty > >;};template< size_t _Idx, class _Ty > struct variant_alternative< _Idx, volatile _Ty >{using type=add_volatile_t< variant_alternative_t< _Idx, _Ty > >;};template< size_t _Idx, class _Ty > struct variant_alternative< _Idx, const volatile _Ty >{using type=add_cv_t< variant_alternative_t< _Idx, _Ty > >;};template< size_t _Idx, class..._Types > struct variant_alternative< _Idx, variant< _Types...> >{using type=_Meta_at_c< _Meta_list< _Types...>, _Idx >;};constexpr auto variant_npos=_Meta_npos;class bad_variant_access:public exception{public:bad_variant_access() _NOEXCEPT=default;virtual const char *__CLR_OR_THIS_CALL what() const _NOEXCEPT override{return("bad variant access");}protected:virtual void _Doraise() const {_RAISE(*this);}};struct _Variant_uses_allocator_t{};template< class _Ty, class=void > struct _Variant_item{remove_cv_t< _Ty > _Elem;template< class..._Types >constexpr explicit _Variant_item(_Types &&..._Args):_Elem(_STD forward< _Types >(_Args)...){}template< class _Alloc, class..._Types, enable_if_t< uses_allocator< _Ty, _Alloc >::value &&is_constructible< _Ty, allocator_arg_t, const _Alloc &, _Types...>::value, int >=0 >constexpr _Variant_item(_Variant_uses_allocator_t, const _Alloc &_Al, _Types &&..._Args):_Elem(allocator_arg, _Al, _STD forward< _Types >(_Args)...){}template< class _Alloc, class..._Types, enable_if_t< uses_allocator< _Ty, _Alloc >::value &&!is_constructible< _Ty, allocator_arg_t, const _Alloc &, _Types...>::value, int >=0 >constexpr _Variant_item(_Variant_uses_allocator_t, const _Alloc &_Al, _Types &&..._Args):_Elem(_STD forward< _Types >(_Args)..., _Al){}template< class _Alloc, class..._Types, enable_if_t<!uses_allocator< _Ty, _Alloc >::value, int >=0 >constexpr _Variant_item(_Variant_uses_allocator_t, const _Alloc &, _Types &&..._Args):_Elem(_STD forward< _Types >(_Args)...){}_CONSTEXPR14 _Ty &get()&{return(_Elem);}constexpr const _Ty &get() const &{return(_Elem);}_CONSTEXPR14 _Ty &&get()&&{return(_STD move(_Elem));}constexpr const _Ty &&get() const &&{return(_STD move(_Elem));}};template< bool _TrivialDestruction, class..._Types > class _Variant_storage_{};template< class..._Types > using _Variant_storage=_Variant_storage_< conjunction< is_trivially_destructible< _Variant_item< _Types > >...>::value, _Types...>;template< class _First, class..._Rest > class _Variant_storage_< true, _First, _Rest...>{public:static constexpr size_t _Size=1+sizeof...(_Rest);union{_Variant_item< _First > _Head;_Variant_storage< _Rest...> _Tail;};_Variant_storage_() _NOEXCEPT{}template< class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, 0 >, _Types &&..._Args):_Head(_STD forward< _Types >(_Args)...){}template< size_t _Idx, class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, _Idx >, _Types &&..._Args) _NOEXCEPT_OP((is_nothrow_constructible< _Variant_storage< _Rest...>, integral_constant< size_t, _Idx-1 >, _Types...>::value)):_Tail(integral_constant< size_t, _Idx-1 >{}, _STD forward< _Types >(_Args)...){}_Variant_storage_(_Variant_storage_ &&)=default;_Variant_storage_(const _Variant_storage_ &)=default;_Variant_storage_ &operator=(_Variant_storage_ &&)=default;_Variant_storage_ &operator=(const _Variant_storage_ &)=default;};template< class _First, class..._Rest > class _Variant_storage_< false, _First, _Rest...>{public:static constexpr size_t _Size=1+sizeof...(_Rest);union{_Variant_item< _First > _Head;_Variant_storage< _Rest...> _Tail;};~_Variant_storage_() _NOEXCEPT{}_Variant_storage_() _NOEXCEPT{}template< class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, 0 >, _Types &&..._Args):_Head(_STD forward< _Types >(_Args)...){}template< size_t _Idx, class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, _Idx >, _Types &&..._Args) _NOEXCEPT_OP((is_nothrow_constructible< _Variant_storage< _Rest...>, integral_constant< size_t, _Idx-1 >, _Types...>::value)):_Tail(integral_constant< size_t, _Idx-1 >{}, _STD forward< _Types >(_Args)...){}_Variant_storage_(_Variant_storage_ &&)=default;_Variant_storage_(const _Variant_storage_ &)=default;_Variant_storage_ &operator=(_Variant_storage_ &&)=default;_Variant_storage_ &operator=(const _Variant_storage_ &)=default;};template< size_t _Idx, class _Storage, enable_if_t< _Idx==0, int >=0 > constexpr decltype(auto) _Variant_raw_get(_Storage &&_Obj){return(_STD forward< _Storage >(_Obj)._Head);}template< size_t _Idx, class _Storage, enable_if_t< _Idx!=0, int >=0 > constexpr decltype(auto) _Variant_raw_get(_Storage &&_Obj){return(_Variant_raw_get< _Idx-1 >(_STD forward< _Storage >(_Obj)._Tail));}template< class _Storage, class _Fn > using _Variant_visit_raw_t=decltype(_STD declval< _Fn >()(integral_constant< size_t, 0 >{}, _Variant_raw_get< 0 >(_STD declval< _Storage >())));template< class _Storage, class _Fn, size_t _Idx > constexpr _Variant_visit_raw_t< _Storage, _Fn > _Variant_visit_raw_dispatch(_Storage &&_Obj, _Fn &&_Func){return(_STD forward< _Fn >(_Func)(integral_constant< size_t, _Idx >{}, _Variant_raw_get< _Idx >(_STD forward< _Storage >(_Obj))));}template< class _Storage, class _Fn, class _Indices > struct _Variant_raw_dispatch_table_;template< class _Storage, class _Fn > using _Variant_raw_dispatch_table=_Variant_raw_dispatch_table_< _Storage, _Fn, make_index_sequence< remove_reference_t< _Storage >::_Size > >;template< class _Storage, class _Fn, size_t..._Idxs > struct _Variant_raw_dispatch_table_< _Storage, _Fn, index_sequence< _Idxs...> >{using _Dispatch_t=_Variant_visit_raw_t< _Storage, _Fn >(*)(_Storage &&, _Fn &&);static constexpr _Dispatch_t _Array[]={&_Variant_visit_raw_dispatch< _Storage, _Fn, _Idxs >...};};template< class _Storage, class _Fn, size_t..._Idxs > constexpr typename _Variant_raw_dispatch_table_< _Storage, _Fn, index_sequence< _Idxs...> >::_Dispatch_t_Variant_raw_dispatch_table_< _Storage, _Fn, index_sequence< _Idxs...> >::_Array[];template< class _Storage, class _Fn, size_t..._Idxs > _CONSTEXPR14 _Variant_visit_raw_t< _Storage, _Fn > _Variant_visit_raw1(const size_t _Idx, _Storage &&_Obj, _Fn &&_Func, index_sequence< _Idxs...>){if(_Idx >=sizeof...(_Idxs)){_THROW_NCEE(bad_variant_access, _EMPTY_ARGUMENT);}constexpr auto &_Array=_Variant_raw_dispatch_table< _Storage, _Fn >::_Array;return(_Array[_Idx](_STD forward< _Storage >(_Obj), _STD forward< _Fn >(_Func)));}template< class _Storage, class _Fn > _CONSTEXPR14 _Variant_visit_raw_t< _Storage, _Fn > _Variant_visit_raw(const size_t _Idx, _Storage &&_Obj, _Fn &&_Func){return(_Variant_visit_raw1(_Idx, _STD forward< _Storage >(_Obj), _STD forward< _Fn >(_Func), make_index_sequence< remove_reference_t< _Storage >::_Size >{}));}template< size_t _Count > using _Variant_index_t=conditional_t<(_Count< static_cast< size_t >((numeric_limits< signed char >::max)())), signed char, conditional_t<(_Count< static_cast< size_t >((numeric_limits< short >::max)())), short, int > >;template< class..._Types > class _Variant_base:private _Variant_storage< _Types...>{public:using _Index_t=_Variant_index_t< sizeof...(_Types)>;static constexpr auto _Invalid_index=static_cast< _Index_t >(-1);_Index_t _Which;using _Storage_t=_Variant_storage< _Types...>;_CONSTEXPR14 _Storage_t &_Storage()&_NOEXCEPT{return(*this);}constexpr const _Storage_t &_Storage() const &_NOEXCEPT{return(*this);}_CONSTEXPR14 _Storage_t &&_Storage()&&_NOEXCEPT{return(_STD move(*this));}constexpr const _Storage_t &&_Storage() const &&_NOEXCEPT{return(_STD move(*this));}_Variant_base():_Storage_t{}, _Which{_Invalid_index}{}template< size_t _Idx, class..._UTypes, enable_if_t< is_constructible< _Variant_item< _Meta_at_c< _Meta_list< _Types...>, _Idx > >, _UTypes...>::value, int >=0 >constexpr explicit _Variant_base(in_place_index_t< _Idx >, _UTypes &&..._Args):_Storage_t(integral_constant< size_t, _Idx >{}, _STD forward< _UTypes >(_Args)...), _Which{static_cast< _Index_t >(_Idx)}{}constexpr bool valueless_by_exception() const _NOEXCEPT{return(_Which< 0);}constexpr size_t index() const _NOEXCEPT{return(static_cast< size_t >(_Which));}void _Set_index(const size_t _Idx){_Which=static_cast< _Index_t >(_Idx);}void _Reset() _NOEXCEPT{if(!this->valueless_by_exception()){_Reset1(_Conjunction_t< is_trivially_destructible< _Variant_item< _Types >>...>{});this->_Set_index(variant_npos);}}private:void _Reset1(true_type) _NOEXCEPT{}void _Reset1(false_type) _NOEXCEPT{_Variant_visit_raw(index(), _Storage(), [](auto, auto &_Obj){_Destroy_in_place(_Obj);});}};template< bool _AllTriviallyDestructible, class..._Types > struct _Variant_destroy_layer_;template< class..._Types > using _Variant_destroy_layer=_Variant_destroy_layer_< conjunction< is_trivially_destructible< _Variant_item< _Types > >...>::value, _Types...>;template< class..._Types > struct _Variant_destroy_layer_< true, _Types...>:_Variant_base< _Types...>{using _Variant_base< _Types...>::_Variant_base;};template< class..._Types > struct _Variant_destroy_layer_< false, _Types...>:_Variant_base< _Types...>{using _Variant_base< _Types...>::_Variant_base;~_Variant_destroy_layer_() _NOEXCEPT{this->_Reset();}};template< class..._Types > struct _Variant_construct_visitor{_Variant_base< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, _Ty &&_Source) const {_Construct_in_place(_Variant_raw_get< _Idx::value >(_Self._Storage()), _STD forward< _Ty >(_Source).get());_Self._Set_index(_Idx::value);}};template< class..._Types > struct _Variant_move_assign_visitor{_Variant_base< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, _Ty &&_Source) const {_Variant_raw_get< _Idx::value >(_Self._Storage()).get()=_STD forward< _Ty >(_Source).get();}};template< class..._Types > struct _Variant_direct_copy_assign_visitor{_Variant_destroy_layer< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, const _Ty &_Source) const {_Variant_raw_get< _Idx::value >(_Self._Storage()).get()=_Source.get();}};template< class..._Types > struct _Variant_indirect_copy_assign_visitor{_Variant_destroy_layer< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, const _Ty &_Source) const {auto _Temporary=_Source;_Self._Reset();_Construct_in_place(_Variant_raw_get< _Idx::value >(_Self._Storage()), _STD move(_Temporary));_Self._Set_index(_Idx::value);}};template< bool _UseTrivialSMFs, class..._Types > struct _Variant_copymove_layer_;template< class..._Types > using _Variant_copymove_layer=_Variant_copymove_layer_< conjunction< is_trivially_copyable< _Variant_item< _Types > >..., negation< is_reference< _Types > >...>::value, _Types...>;template< class..._Types > struct _Variant_copymove_layer_< true, _Types...>:_Variant_destroy_layer< _Types...>{using _Variant_destroy_layer< _Types...>::_Variant_destroy_layer;};template< class..._Types > struct _Variant_copymove_layer_< false, _Types...>:_Variant_destroy_layer< _Types...>{using _Variant_destroy_layer< _Types...>::_Variant_destroy_layer;_Variant_copymove_layer_()=default;_Variant_copymove_layer_(const _Variant_copymove_layer_ &_That){if(!_That.valueless_by_exception()){_Variant_visit_raw(_That.index(), _That._Storage(), _Variant_construct_visitor< _Types...>{*this});}}_Variant_copymove_layer_(_Variant_copymove_layer_ &&_That) _NOEXCEPT_OP(conjunction< is_nothrow_move_constructible< _Types >...>::value){if(!_That.valueless_by_exception()){_Variant_visit_raw(_That.index(), _STD move(_That)._Storage(), _Variant_construct_visitor< _Types...>{*this});}}_Variant_copymove_layer_ &operator=(const _Variant_copymove_layer_ &_That){if(this->_Which==_That._Which){if(!this->valueless_by_exception()){_Variant_visit_raw(_That.index(), _That._Storage(), _Variant_direct_copy_assign_visitor< _Types...>{*this});}}else{if(_That.valueless_by_exception()){this-> _Reset()
Definition: variant:942
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Fty>
template<class _Alloc >
function< _Fty >::function ( allocator_arg_t  ,
const _Alloc &   
)
inline
497  { // construct empty function wrapper, allocator
498  }
template<class _Fty>
template<class _Alloc >
function< _Fty >::function ( allocator_arg_t  ,
const _Alloc &  ,
nullptr_t   
)
inline
502  { // construct empty function wrapper from null pointer, allocator
503  }
template<class _Fty>
template<class _Alloc >
function< _Fty >::function ( allocator_arg_t  ,
const _Alloc &  _Ax,
const _Myt _Right 
)
inline
507  { // construct wrapper holding copy of _Right, allocator
508  this->_Reset_alloc(_Right, _Ax);
509  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Fty>
template<class _Fx , class _Alloc , class = typename _Mybase::template _Enable_if_callable_t<_Fx&>>
function< _Fty >::function ( allocator_arg_t  ,
const _Alloc &  _Ax,
_Fx  _Func 
)
inline
515  { // construct wrapper holding copy of _Func, allocator
516  this->_Reset_alloc(_STD move(_Func), _Ax);
517  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Fty>
function< _Fty >::~function ( )
inline
520  { // destroy the object
521  }
template<class _Fty>
function< _Fty >::function ( _Myt &&  _Right)
inline
530  { // construct holding moved copy of _Right
531  this->_Reset_move(_STD move(_Right));
532  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Fty>
template<class _Alloc >
function< _Fty >::function ( allocator_arg_t  ,
const _Alloc &  _Al,
_Myt &&  _Right 
)
inline
536  { // construct wrapper holding moved copy of _Right, allocator
537  this->_Reset_alloc(_STD move(_Right), _Al);
538  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Function Documentation

template<class _Fty>
function< _Fty >::operator bool ( ) const
inlineexplicit
587  { // test if wrapper holds function object
588  return (!this->_Empty());
589  }
template<class _Fty>
_Myt& function< _Fty >::operator= ( const _Myt _Right)
inline
524  { // assign _Right
525  _Myt(_Right).swap(*this);
526  return (*this);
527  }
function< _Fty > _Myt
Definition: functional:473
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Fty>
_Myt& function< _Fty >::operator= ( _Myt &&  _Right)
inline
541  { // assign by moving _Right
542  if (this != _STD addressof(_Right))
543  { // clean up and copy
544  this->_Tidy();
545  this->_Reset_move(_STD move(_Right));
546  }
547  return (*this);
548  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Fty>
template<class _Fx , class = typename _Mybase::template _Enable_if_callable_t<decay_t<_Fx>&>>
_Myt& function< _Fty >::operator= ( _Fx &&  _Func)
inline
553  { // assign function object _Func
554  _Myt(_STD forward<_Fx>(_Func)).swap(*this);
555  return (*this);
556  }
function< _Fty > _Myt
Definition: functional:473
template<class _Fty>
_Myt& function< _Fty >::operator= ( nullptr_t  )
inline
568  { // clear function object
569  this->_Tidy();
570  return (*this);
571  }
template<class _Fty>
template<class _Fx >
_Myt& function< _Fty >::operator= ( reference_wrapper< _Fx >  _Func)
inline
575  { // assign wrapper holding reference_wrapper to function object
576  this->_Tidy();
577  this->_Reset(_Func);
578  return (*this);
579  }
struct _Meta_at_< _Meta_list< _Types...>, _Idx, enable_if_t<(_Idx< sizeof...(_Types))> >:decltype(_Meta_at_impl< _Meta_repeat_n_c< _Idx, void * >>::_Eval(_Type_as_pointer< _Types >()...)){};template< class _List, class _Ty > struct _Meta_find_index_{};template< class _List, class _Ty > using _Meta_find_index=typename _Meta_find_index_< _List, _Ty >::type;constexpr auto _Meta_npos=static_cast< size_t >(-1);constexpr size_t _Meta_find_index_i_(bool const *const _Ptr, const size_t _Count, const size_t _Idx=0){return(_Idx >=_Count?_Meta_npos:_Ptr[_Idx]?_Idx:_Meta_find_index_i_(_Ptr, _Count, _Idx+1));}template< class _Ty > struct _Meta_find_index_< _Meta_list<>, _Ty >:integral_constant< size_t, _Meta_npos >{};template< class..._Types, class _Ty > struct _Meta_find_index_< _Meta_list< _Types...>, _Ty >{static constexpr bool _Bools[]={is_same< _Types, _Ty >::value...};using type=integral_constant< size_t, _Meta_find_index_i_(_Bools, sizeof...(_Types))>;};template< class _List, class _Ty > struct _Meta_find_unique_index_{};template< class _List, class _Ty > using _Meta_find_unique_index=typename _Meta_find_unique_index_< _List, _Ty >::type;constexpr size_t _Meta_find_unique_index_i_2(bool const *const _Ptr, const size_t _Count, const size_t _First){return(_First!=_Meta_npos &&_Meta_find_index_i_(_Ptr, _Count, _First+1)==_Meta_npos?_First:_Meta_npos);}constexpr size_t _Meta_find_unique_index_i_(bool const *const _Ptr, const size_t _Count){return(_Meta_find_unique_index_i_2(_Ptr, _Count, _Meta_find_index_i_(_Ptr, _Count)));}template< class _Ty > struct _Meta_find_unique_index_< _Meta_list<>, _Ty >:integral_constant< size_t, _Meta_npos >{};template< class..._Types, class _Ty > struct _Meta_find_unique_index_< _Meta_list< _Types...>, _Ty >{using type=integral_constant< size_t, _Meta_find_unique_index_i_(_Meta_find_index_< _Meta_list< _Types...>, _Ty >::_Bools, sizeof...(_Types))>;};template< class > struct _Meta_as_list_{};template< class _Ty > using _Meta_as_list=typename _Meta_as_list_< _Ty >::type;template< template< class > class _Template, class..._Types > struct _Meta_as_list_< _Template< _Types...> >{using type=_Meta_list< _Types...>;};template< class _Ty, _Ty..._Idxs > struct _Meta_as_list_< integer_sequence< _Ty, _Idxs...> >{using type=_Meta_list< integral_constant< _Ty, _Idxs >...>;};template< class _List > struct _Meta_as_integer_sequence_{};template< class _List > using _Meta_as_integer_sequence=typename _Meta_as_integer_sequence_< _List >::type;template< class _Ty, _Ty..._Idxs > struct _Meta_as_integer_sequence_< _Meta_list< integral_constant< _Ty, _Idxs >...> >{using type=integer_sequence< _Ty, _Idxs...>;};template< class...> struct _Meta_concat_{};template< class..._Types > using _Meta_concat=typename _Meta_concat_< _Types...>::type;template<> struct _Meta_concat_< _Meta_list<> >{using type=_Meta_list<>;};template< class..._Items1 > struct _Meta_concat_< _Meta_list< _Items1...> >{using type=_Meta_list< _Items1...>;};template< class..._Items1, class..._Items2 > struct _Meta_concat_< _Meta_list< _Items1...>, _Meta_list< _Items2...> >{using type=_Meta_list< _Items1..., _Items2...>;};template< class..._Items1, class..._Items2, class..._Items3 > struct _Meta_concat_< _Meta_list< _Items1...>, _Meta_list< _Items2...>, _Meta_list< _Items3...> >{using type=_Meta_list< _Items1..., _Items2..., _Items3...>;};template< class..._Items1, class..._Items2, class..._Items3, class..._Rest > struct _Meta_concat_< _Meta_list< _Items1...>, _Meta_list< _Items2...>, _Meta_list< _Items3...>, _Rest...>{using type=_Meta_concat< _Meta_list< _Items1..., _Items2..., _Items3...>, _Rest...>;};template< class _ListOfLists > using _Meta_join=_Meta_apply< _Meta_quote< _Meta_concat >, _ListOfLists >;template< class > struct _Meta_cartesian_product_{};template< class _ListOfLists > using _Meta_cartesian_product=typename _Meta_cartesian_product_< _ListOfLists >::type;template<> struct _Meta_cartesian_product_< _Meta_list<> >{using type=_Meta_list<>;};template< class..._Items > struct _Meta_cartesian_product_< _Meta_list< _Meta_list< _Items...> > >{using type=_Meta_list< _Meta_list< _Items >...>;};template< class..._Items, class..._Lists > struct _Meta_cartesian_product_< _Meta_list< _Meta_list< _Items...>, _Lists...> >{using type=_Meta_join< _Meta_list< _Meta_transform< _Meta_bind_back< _Meta_quote< _Meta_push_front >, _Items >, _Meta_cartesian_product< _Meta_list< _Lists...> > >...> >;};template< class..._Types > class variant;template< class _Ty > struct variant_size;template< class _Ty > struct variant_size< const _Ty >:variant_size< _Ty >::type{};template< class _Ty > struct variant_size< volatile _Ty >:variant_size< _Ty >::type{};template< class _Ty > struct variant_size< const volatile _Ty >:variant_size< _Ty >::type{};template< class _Ty > constexpr size_t variant_size_v=variant_size< _Ty >::value;template< class..._Types > struct variant_size< variant< _Types...> >:integral_constant< size_t, sizeof...(_Types)>{};template< size_t _Idx, class _Ty > struct variant_alternative;template< size_t _Idx, class _Ty > using variant_alternative_t=typename variant_alternative< _Idx, _Ty >::type;template< size_t _Idx, class _Ty > struct variant_alternative< _Idx, const _Ty >{using type=add_const_t< variant_alternative_t< _Idx, _Ty > >;};template< size_t _Idx, class _Ty > struct variant_alternative< _Idx, volatile _Ty >{using type=add_volatile_t< variant_alternative_t< _Idx, _Ty > >;};template< size_t _Idx, class _Ty > struct variant_alternative< _Idx, const volatile _Ty >{using type=add_cv_t< variant_alternative_t< _Idx, _Ty > >;};template< size_t _Idx, class..._Types > struct variant_alternative< _Idx, variant< _Types...> >{using type=_Meta_at_c< _Meta_list< _Types...>, _Idx >;};constexpr auto variant_npos=_Meta_npos;class bad_variant_access:public exception{public:bad_variant_access() _NOEXCEPT=default;virtual const char *__CLR_OR_THIS_CALL what() const _NOEXCEPT override{return("bad variant access");}protected:virtual void _Doraise() const {_RAISE(*this);}};struct _Variant_uses_allocator_t{};template< class _Ty, class=void > struct _Variant_item{remove_cv_t< _Ty > _Elem;template< class..._Types >constexpr explicit _Variant_item(_Types &&..._Args):_Elem(_STD forward< _Types >(_Args)...){}template< class _Alloc, class..._Types, enable_if_t< uses_allocator< _Ty, _Alloc >::value &&is_constructible< _Ty, allocator_arg_t, const _Alloc &, _Types...>::value, int >=0 >constexpr _Variant_item(_Variant_uses_allocator_t, const _Alloc &_Al, _Types &&..._Args):_Elem(allocator_arg, _Al, _STD forward< _Types >(_Args)...){}template< class _Alloc, class..._Types, enable_if_t< uses_allocator< _Ty, _Alloc >::value &&!is_constructible< _Ty, allocator_arg_t, const _Alloc &, _Types...>::value, int >=0 >constexpr _Variant_item(_Variant_uses_allocator_t, const _Alloc &_Al, _Types &&..._Args):_Elem(_STD forward< _Types >(_Args)..., _Al){}template< class _Alloc, class..._Types, enable_if_t<!uses_allocator< _Ty, _Alloc >::value, int >=0 >constexpr _Variant_item(_Variant_uses_allocator_t, const _Alloc &, _Types &&..._Args):_Elem(_STD forward< _Types >(_Args)...){}_CONSTEXPR14 _Ty &get()&{return(_Elem);}constexpr const _Ty &get() const &{return(_Elem);}_CONSTEXPR14 _Ty &&get()&&{return(_STD move(_Elem));}constexpr const _Ty &&get() const &&{return(_STD move(_Elem));}};template< bool _TrivialDestruction, class..._Types > class _Variant_storage_{};template< class..._Types > using _Variant_storage=_Variant_storage_< conjunction< is_trivially_destructible< _Variant_item< _Types > >...>::value, _Types...>;template< class _First, class..._Rest > class _Variant_storage_< true, _First, _Rest...>{public:static constexpr size_t _Size=1+sizeof...(_Rest);union{_Variant_item< _First > _Head;_Variant_storage< _Rest...> _Tail;};_Variant_storage_() _NOEXCEPT{}template< class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, 0 >, _Types &&..._Args):_Head(_STD forward< _Types >(_Args)...){}template< size_t _Idx, class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, _Idx >, _Types &&..._Args) _NOEXCEPT_OP((is_nothrow_constructible< _Variant_storage< _Rest...>, integral_constant< size_t, _Idx-1 >, _Types...>::value)):_Tail(integral_constant< size_t, _Idx-1 >{}, _STD forward< _Types >(_Args)...){}_Variant_storage_(_Variant_storage_ &&)=default;_Variant_storage_(const _Variant_storage_ &)=default;_Variant_storage_ &operator=(_Variant_storage_ &&)=default;_Variant_storage_ &operator=(const _Variant_storage_ &)=default;};template< class _First, class..._Rest > class _Variant_storage_< false, _First, _Rest...>{public:static constexpr size_t _Size=1+sizeof...(_Rest);union{_Variant_item< _First > _Head;_Variant_storage< _Rest...> _Tail;};~_Variant_storage_() _NOEXCEPT{}_Variant_storage_() _NOEXCEPT{}template< class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, 0 >, _Types &&..._Args):_Head(_STD forward< _Types >(_Args)...){}template< size_t _Idx, class..._Types >constexpr explicit _Variant_storage_(integral_constant< size_t, _Idx >, _Types &&..._Args) _NOEXCEPT_OP((is_nothrow_constructible< _Variant_storage< _Rest...>, integral_constant< size_t, _Idx-1 >, _Types...>::value)):_Tail(integral_constant< size_t, _Idx-1 >{}, _STD forward< _Types >(_Args)...){}_Variant_storage_(_Variant_storage_ &&)=default;_Variant_storage_(const _Variant_storage_ &)=default;_Variant_storage_ &operator=(_Variant_storage_ &&)=default;_Variant_storage_ &operator=(const _Variant_storage_ &)=default;};template< size_t _Idx, class _Storage, enable_if_t< _Idx==0, int >=0 > constexpr decltype(auto) _Variant_raw_get(_Storage &&_Obj){return(_STD forward< _Storage >(_Obj)._Head);}template< size_t _Idx, class _Storage, enable_if_t< _Idx!=0, int >=0 > constexpr decltype(auto) _Variant_raw_get(_Storage &&_Obj){return(_Variant_raw_get< _Idx-1 >(_STD forward< _Storage >(_Obj)._Tail));}template< class _Storage, class _Fn > using _Variant_visit_raw_t=decltype(_STD declval< _Fn >()(integral_constant< size_t, 0 >{}, _Variant_raw_get< 0 >(_STD declval< _Storage >())));template< class _Storage, class _Fn, size_t _Idx > constexpr _Variant_visit_raw_t< _Storage, _Fn > _Variant_visit_raw_dispatch(_Storage &&_Obj, _Fn &&_Func){return(_STD forward< _Fn >(_Func)(integral_constant< size_t, _Idx >{}, _Variant_raw_get< _Idx >(_STD forward< _Storage >(_Obj))));}template< class _Storage, class _Fn, class _Indices > struct _Variant_raw_dispatch_table_;template< class _Storage, class _Fn > using _Variant_raw_dispatch_table=_Variant_raw_dispatch_table_< _Storage, _Fn, make_index_sequence< remove_reference_t< _Storage >::_Size > >;template< class _Storage, class _Fn, size_t..._Idxs > struct _Variant_raw_dispatch_table_< _Storage, _Fn, index_sequence< _Idxs...> >{using _Dispatch_t=_Variant_visit_raw_t< _Storage, _Fn >(*)(_Storage &&, _Fn &&);static constexpr _Dispatch_t _Array[]={&_Variant_visit_raw_dispatch< _Storage, _Fn, _Idxs >...};};template< class _Storage, class _Fn, size_t..._Idxs > constexpr typename _Variant_raw_dispatch_table_< _Storage, _Fn, index_sequence< _Idxs...> >::_Dispatch_t_Variant_raw_dispatch_table_< _Storage, _Fn, index_sequence< _Idxs...> >::_Array[];template< class _Storage, class _Fn, size_t..._Idxs > _CONSTEXPR14 _Variant_visit_raw_t< _Storage, _Fn > _Variant_visit_raw1(const size_t _Idx, _Storage &&_Obj, _Fn &&_Func, index_sequence< _Idxs...>){if(_Idx >=sizeof...(_Idxs)){_THROW_NCEE(bad_variant_access, _EMPTY_ARGUMENT);}constexpr auto &_Array=_Variant_raw_dispatch_table< _Storage, _Fn >::_Array;return(_Array[_Idx](_STD forward< _Storage >(_Obj), _STD forward< _Fn >(_Func)));}template< class _Storage, class _Fn > _CONSTEXPR14 _Variant_visit_raw_t< _Storage, _Fn > _Variant_visit_raw(const size_t _Idx, _Storage &&_Obj, _Fn &&_Func){return(_Variant_visit_raw1(_Idx, _STD forward< _Storage >(_Obj), _STD forward< _Fn >(_Func), make_index_sequence< remove_reference_t< _Storage >::_Size >{}));}template< size_t _Count > using _Variant_index_t=conditional_t<(_Count< static_cast< size_t >((numeric_limits< signed char >::max)())), signed char, conditional_t<(_Count< static_cast< size_t >((numeric_limits< short >::max)())), short, int > >;template< class..._Types > class _Variant_base:private _Variant_storage< _Types...>{public:using _Index_t=_Variant_index_t< sizeof...(_Types)>;static constexpr auto _Invalid_index=static_cast< _Index_t >(-1);_Index_t _Which;using _Storage_t=_Variant_storage< _Types...>;_CONSTEXPR14 _Storage_t &_Storage()&_NOEXCEPT{return(*this);}constexpr const _Storage_t &_Storage() const &_NOEXCEPT{return(*this);}_CONSTEXPR14 _Storage_t &&_Storage()&&_NOEXCEPT{return(_STD move(*this));}constexpr const _Storage_t &&_Storage() const &&_NOEXCEPT{return(_STD move(*this));}_Variant_base():_Storage_t{}, _Which{_Invalid_index}{}template< size_t _Idx, class..._UTypes, enable_if_t< is_constructible< _Variant_item< _Meta_at_c< _Meta_list< _Types...>, _Idx > >, _UTypes...>::value, int >=0 >constexpr explicit _Variant_base(in_place_index_t< _Idx >, _UTypes &&..._Args):_Storage_t(integral_constant< size_t, _Idx >{}, _STD forward< _UTypes >(_Args)...), _Which{static_cast< _Index_t >(_Idx)}{}constexpr bool valueless_by_exception() const _NOEXCEPT{return(_Which< 0);}constexpr size_t index() const _NOEXCEPT{return(static_cast< size_t >(_Which));}void _Set_index(const size_t _Idx){_Which=static_cast< _Index_t >(_Idx);}void _Reset() _NOEXCEPT{if(!this->valueless_by_exception()){_Reset1(_Conjunction_t< is_trivially_destructible< _Variant_item< _Types >>...>{});this->_Set_index(variant_npos);}}private:void _Reset1(true_type) _NOEXCEPT{}void _Reset1(false_type) _NOEXCEPT{_Variant_visit_raw(index(), _Storage(), [](auto, auto &_Obj){_Destroy_in_place(_Obj);});}};template< bool _AllTriviallyDestructible, class..._Types > struct _Variant_destroy_layer_;template< class..._Types > using _Variant_destroy_layer=_Variant_destroy_layer_< conjunction< is_trivially_destructible< _Variant_item< _Types > >...>::value, _Types...>;template< class..._Types > struct _Variant_destroy_layer_< true, _Types...>:_Variant_base< _Types...>{using _Variant_base< _Types...>::_Variant_base;};template< class..._Types > struct _Variant_destroy_layer_< false, _Types...>:_Variant_base< _Types...>{using _Variant_base< _Types...>::_Variant_base;~_Variant_destroy_layer_() _NOEXCEPT{this->_Reset();}};template< class..._Types > struct _Variant_construct_visitor{_Variant_base< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, _Ty &&_Source) const {_Construct_in_place(_Variant_raw_get< _Idx::value >(_Self._Storage()), _STD forward< _Ty >(_Source).get());_Self._Set_index(_Idx::value);}};template< class..._Types > struct _Variant_move_assign_visitor{_Variant_base< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, _Ty &&_Source) const {_Variant_raw_get< _Idx::value >(_Self._Storage()).get()=_STD forward< _Ty >(_Source).get();}};template< class..._Types > struct _Variant_direct_copy_assign_visitor{_Variant_destroy_layer< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, const _Ty &_Source) const {_Variant_raw_get< _Idx::value >(_Self._Storage()).get()=_Source.get();}};template< class..._Types > struct _Variant_indirect_copy_assign_visitor{_Variant_destroy_layer< _Types...> &_Self;template< class _Idx, class _Ty >void operator()(_Idx, const _Ty &_Source) const {auto _Temporary=_Source;_Self._Reset();_Construct_in_place(_Variant_raw_get< _Idx::value >(_Self._Storage()), _STD move(_Temporary));_Self._Set_index(_Idx::value);}};template< bool _UseTrivialSMFs, class..._Types > struct _Variant_copymove_layer_;template< class..._Types > using _Variant_copymove_layer=_Variant_copymove_layer_< conjunction< is_trivially_copyable< _Variant_item< _Types > >..., negation< is_reference< _Types > >...>::value, _Types...>;template< class..._Types > struct _Variant_copymove_layer_< true, _Types...>:_Variant_destroy_layer< _Types...>{using _Variant_destroy_layer< _Types...>::_Variant_destroy_layer;};template< class..._Types > struct _Variant_copymove_layer_< false, _Types...>:_Variant_destroy_layer< _Types...>{using _Variant_destroy_layer< _Types...>::_Variant_destroy_layer;_Variant_copymove_layer_()=default;_Variant_copymove_layer_(const _Variant_copymove_layer_ &_That){if(!_That.valueless_by_exception()){_Variant_visit_raw(_That.index(), _That._Storage(), _Variant_construct_visitor< _Types...>{*this});}}_Variant_copymove_layer_(_Variant_copymove_layer_ &&_That) _NOEXCEPT_OP(conjunction< is_nothrow_move_constructible< _Types >...>::value){if(!_That.valueless_by_exception()){_Variant_visit_raw(_That.index(), _STD move(_That)._Storage(), _Variant_construct_visitor< _Types...>{*this});}}_Variant_copymove_layer_ &operator=(const _Variant_copymove_layer_ &_That){if(this->_Which==_That._Which){if(!this->valueless_by_exception()){_Variant_visit_raw(_That.index(), _That._Storage(), _Variant_direct_copy_assign_visitor< _Types...>{*this});}}else{if(_That.valueless_by_exception()){this-> _Reset()
Definition: variant:942
template<class _Fty>
void function< _Fty >::swap ( _Myt _Right)
inline
582  { // swap with _Right
583  this->_Swap(_Right);
584  }
void _Swap(_Myt &_Right) _NOEXCEPT
Definition: functional:386
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Fty>
template<class _Fx >
_Fx* function< _Fty >::target ( )
inline
598  { // return pointer to target object
599  return (static_cast<_Fx *>(const_cast<void *>(
600  this->_Target(typeid(_Fx)))));
601  }
const void * _Target(const type_info &_Info) const _NOEXCEPT
Definition: functional:408
template<class _Fty>
template<class _Fx >
const _Fx* function< _Fty >::target ( ) const
inline
605  { // return pointer to target object
606  return (static_cast<const _Fx *>(this->_Target(typeid(_Fx))));
607  }
const void * _Target(const type_info &_Info) const _NOEXCEPT
Definition: functional:408
template<class _Fty>
const type_info& function< _Fty >::target_type ( ) const
inline
592  { // return type_info object for target type
593  return (this->_Target_type());
594  }
const type_info & _Target_type() const _NOEXCEPT
Definition: functional:403

The documentation for this class was generated from the following file: