libstdc++
|
Public Types | |
typedef _Res | result_type |
Public Member Functions | |
function () noexcept | |
template<typename _Functor , typename = _Requires<__not_<is_same<_Functor, function>>, void>, typename = _Requires<_Callable<_Functor>, void>> | |
function (_Functor) | |
function (const function &__x) | |
function (function &&__x) noexcept | |
function (nullptr_t) noexcept | |
operator bool () const noexcept | |
_Res | operator() (_ArgTypes... __args) const |
template<typename _Functor > | |
_Requires< _Callable< typename decay< _Functor >::type >, function & > | operator= (_Functor &&__f) |
function & | operator= (const function &__x) |
function & | operator= (function &&__x) noexcept |
function & | operator= (nullptr_t) noexcept |
template<typename _Functor > | |
function & | operator= (reference_wrapper< _Functor > __f) noexcept |
void | swap (function &__x) noexcept |
const type_info & | target_type () const noexcept |
template<typename _Functor > | |
_Functor * | target () noexcept |
template<typename _Functor > | |
const _Functor * | target () const noexcept |
Primary class template for std::function.
Polymorphic function wrapper.
Definition at line 303 of file std_function.h.
|
inlinenoexcept |
Default construct creates an empty function call wrapper.
!
(bool)*this Definition at line 330 of file std_function.h.
|
inlinenoexcept |
Creates an empty function call wrapper.
!
(bool)*this Definition at line 337 of file std_function.h.
std::function< _Res(_ArgTypes...)>::function | ( | const function< _Res(_ArgTypes...)> & | __x | ) |
Function copy constructor.
__x | A function object with identical call signature. |
bool(*this)
== bool(__x)The newly-created function contains a copy of the target of __x (if it has one).
Definition at line 587 of file std_function.h.
|
inlinenoexcept |
Function move constructor.
__x | A function object rvalue with identical call signature. |
The newly-created function contains the target of __x (if it has one).
Definition at line 357 of file std_function.h.
std::function< _Res(_ArgTypes...)>::function | ( | _Functor | __f | ) |
Builds a function that targets a copy of the incoming function object.
__f | A function object that is callable with parameters of type T1 , T2 , ..., TN and returns a value convertible to Res . |
The newly-created function object will target a copy of __f. If __f is reference_wrapper<F>
, then this function object will contain a reference to the function object __f.get()
. If __f is a NULL function pointer or NULL pointer-to-member, the newly-created object will be empty.
If __f is a non-NULL function pointer or an object of type reference_wrapper<F>
, this function will not throw.
Definition at line 601 of file std_function.h.
References std::move().
|
inlineexplicitnoexcept |
Determine if the function wrapper has a target.
true
when this function object contains a target, or false
when it is empty.This function will not throw an exception.
Definition at line 498 of file std_function.h.
_Res std::function< _Res(_ArgTypes...)>::operator() | ( | _ArgTypes... | __args | ) | const |
Invokes the function targeted by *this
.
bad_function_call | when ! (bool)*this |
The function call operator invokes the target function object stored by this
.
Definition at line 617 of file std_function.h.
|
inline |
Function assignment to a new target.
__f | A function object that is callable with parameters of type T1 , T2 , ..., TN and returns a value convertible to Res . |
*this
This function object wrapper will target a copy of __f. If __f is reference_wrapper<F>
, then this function object will contain a reference to the function object __f.get()
. If __f is a NULL function pointer or NULL pointer-to-member, this
object will be empty.
If __f is a non-NULL function pointer or an object of type reference_wrapper<F>
, this function will not throw.
Definition at line 457 of file std_function.h.
|
inline |
Function assignment operator.
__x | A function with identical call signature. |
(bool)*this == (bool)x *this
The target of __x is copied to *this
. If __x has no target, then *this
will be empty.
If __x targets a function pointer or a reference to a function object, then this operation will not throw an exception.
Definition at line 396 of file std_function.h.
|
inlinenoexcept |
Function move-assignment operator.
__x | A function rvalue with identical call signature. |
*this
The target of __x is moved to *this
. If __x has no target, then *this
will be empty.
If __x targets a function pointer or a reference to a function object, then this operation will not throw an exception.
Definition at line 414 of file std_function.h.
References std::move().
|
inlinenoexcept |
Function assignment to zero.
!
(bool)*this *this
The target of *this
is deallocated, leaving it empty.
Definition at line 428 of file std_function.h.
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 466 of file std_function.h.
|
inlinenoexcept |
Swap the targets of two function objects.
__x | A function with identical call signature. |
Swap the targets of this
function object and __f. This function will not throw an exception.
Definition at line 481 of file std_function.h.
|
noexcept |
Access the stored target function object.
typeid(_Functor)
.equals(target_type()); otherwise, a NULL pointer.This function does not throw exceptions.
Definition at line 655 of file std_function.h.
|
noexcept |
Access the stored target function object.
typeid(_Functor)
.equals(target_type()); otherwise, a NULL pointer.This function does not throw exceptions.
Definition at line 644 of file std_function.h.
|
noexcept |
Determine the type of the target of this function object wrapper.
typeid(void)
if !
(bool)*this.This function will not throw an exception.
Definition at line 628 of file std_function.h.