function(allocator_arg_t,const_Alloc&) _NOEXCEPT{} template<class_Alloc> _LIBCPP_INLINE_VISIBILITY function(allocator_arg_t,const_Alloc&,nullptr_t) _NOEXCEPT{} template<class_Alloc> function(allocator_arg_t,const_Alloc&,constfunction&); template<class_Al...
std::uses_allocator<std::function> (C++11)(C++17 前) 特化std::uses_allocator类型特性 (类模板特化) 推导指引(C++17 起) 注解 当结果类型为引用的std::function从无尾随返回类型的 lambda 表达式初始化时需要留心。由于 auto 推导的起效方式,这种 lambda 表达式将始终返回纯右值。故而结果引用将始终绑定到生...
operator=(_Fp&&); ~function(); // function modifiers: void swap(function&) _NOEXCEPT; #if _LIBCPP_STD_VER <= 14 template<class _Fp, class _Alloc> _LIBCPP_INLINE_VISIBILITY void assign(_Fp&& __f, const _Alloc& __a) {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f))...
同样还有一个模板赋值函数,参数是通用引用。 每个构造函数都有一个添加了std::allocator_arg_t作为第一个参数、内存分配器对象作为第二个参数的版本,C++17中已经移除(GCC从未提供,可能是因为std::function的内存分配无法自定义)。同样删除的还有assign,也是与内存分配器相关的。 另外有一个以std::reference_wrapper...
特化std::uses_allocator类型特性 (类模板特化) 推导指引(C++17 起) 注解 当结果类型为引用的std::function从无尾随返回类型的 lambda 表达式初始化时需要留心。由于 auto 推导的起效方式,这种 lambda 表达式将始终返回纯右值。故而结果引用将始终绑定到生命期在std::function::operator()返回时结束的临时量。
1> _Alloc=std::allocator<std::_Func_class<int,Zot *>>, 1> _Fty=int (__thiscall Zot::* const &)(void) 1> ] 1> vc\include\functional(515) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Reset_alloc<_Fret,Zot,std::allocator<_Ty>>(...
(__buf_) && is_nothrow_copy_constructible<_Fp>::value && is_nothrow_copy_constructible<_FunAlloc>::value) { __f_ = ::new ((void*)&__buf_) _Fun(_VSTD::move(__f), _Alloc(__af)); } else { typedef __allocator_destructor<_FunAlloc> _Dp; unique_ptr<__func, _Dp> __hold...
{function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);} #endif // function capacity: _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIToperatorbool()const_NOEXCEPT{ returnstatic_cast<bool>(__f_); } // deleted overloads close possible hole in the type system ...
std::uses_allocator<std::function> (C++11) (until C++17) specializes the std::uses_allocator type trait (class template specialization) Deduction guides(since C++17)ExampleRun this code #include <functional> #include <iostream> struct Foo { Foo(int num) : num_(num) {} void print_add...
特化std::uses_allocator类型特征 (类模板特化) 推导指引(C++17 起) 注解 当结果类型为引用的std::function从无尾随返回类型的 lambda 表达式初始化时需要留心。由于auto推导的起效方式,这种 lambda 表达式将始终返回纯右值。故而结果引用将始终绑定到生命期在std::function::operator()返回时结束的临时量。