libstdc++
|
#include <std_function.h>
Public Types | |
typedef _Res | result_type |
Public Member Functions | |
function () noexcept | |
template<typename _Functor, typename _Constraints = _Requires<_Callable<_Functor>>> | |
function (_Functor &&__f) noexcept(_Handler< _Functor >::template _S_nothrow_init< _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< _Functor >, function & > | operator= (_Functor &&__f) noexcept(_Handler< _Functor >::template _S_nothrow_init< _Functor >()) |
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 |
Polymorphic function wrapper.
Definition at line 324 of file std_function.h.
typedef _Res std::function< _Res(_ArgTypes...)>::result_type |
Definition at line 348 of file std_function.h.
|
inlinenoexcept |
Default construct creates an empty function call wrapper.
!(bool)*this
Definition at line 356 of file std_function.h.
References function().
Referenced by function(), function(), function(), function(), function(), operator=(), operator=(), operator=(), operator=(), operator=(), swap(), and target().
|
inlinenoexcept |
Creates an empty function call wrapper.
!
(bool)*this Definition at line 363 of file std_function.h.
References function().
|
inline |
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 374 of file std_function.h.
References function().
|
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 392 of file std_function.h.
References function().
|
inlinenoexcept |
Builds a function that targets a copy of the incoming function object.
__f | A function object that is callable with parameters of type ArgTypes... 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, null pointer-to-member, or empty std::function
, 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 423 of file std_function.h.
References function(), and std::forward().
|
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 exceptions.
Definition at line 561 of file std_function.h.
|
inline |
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 575 of file std_function.h.
References std::forward(), and operator()().
Referenced by operator()().
|
inlinenoexcept |
Function assignment to a new target.
__f | A function object that is callable with parameters of type _ArgTypes... 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 519 of file std_function.h.
References function(), std::forward(), and operator=().
|
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 457 of file std_function.h.
References function(), and operator=().
Referenced by operator=(), operator=(), operator=(), operator=(), and operator=().
|
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 475 of file std_function.h.
References function(), std::move(), and operator=().
|
inlinenoexcept |
Function assignment to empty.
!(bool)*this
*this
The target of *this
is deallocated, leaving it empty.
Definition at line 489 of file std_function.h.
References function(), and operator=().
|
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 529 of file std_function.h.
References function(), and operator=().
|
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 exceptions.
Definition at line 544 of file std_function.h.
References function(), and swap().
Referenced by swap().
|
inlinenoexcept |
Access the stored target function object.
typeid(_Functor).equals(target_type())
; otherwise, a null pointer.This function does not throw exceptions.
Definition at line 631 of file std_function.h.
References target(), and target_type().
|
inlinenoexcept |
Access the stored target function object.
typeid(_Functor).equals(target_type())
; otherwise, a null pointer.This function does not throw exceptions.
Definition at line 620 of file std_function.h.
References function(), and target().
|
inlinenoexcept |
Determine the type of the target of this function object wrapper.
typeid(void)
if !(bool)*this
.This function will not throw exceptions.
Definition at line 594 of file std_function.h.
References target_type().
Referenced by target(), and target_type().