|
| function () noexcept |
| Null function constructor.
|
|
template<typename C0, typename C1> |
| function (C1 *base, R(C0::*mfunc)(A...)) noexcept |
| Member function constructor.
|
|
| function (const function &o) noexcept=default |
|
template<typename I> |
| function (const I &data, R(*func)(I &, A...)) noexcept |
| Capture by value (copy) function constructor.
|
|
| function (delegate_type _delegate, int dummy) noexcept |
| Internally used delegate_t<R(A...)> constructor.
|
|
| function (function &&o) noexcept=default |
|
template<typename I> |
| function (I &&data, R(*func)(I &, A...)) noexcept |
| Capture by value (move) function constructor.
|
|
template<typename I> |
| function (I *data_ptr, R(*func)(I *, A...)) noexcept |
| Capture by-reference function constructor.
|
|
template<typename L, std::enable_if_t<!std::is_same_v< L, std::shared_ptr< delegate_type > > &&!std::is_pointer_v< L > &&!std::is_same_v< L, R(A...)> &&!std::is_same_v< L, function< R(A...)> >, bool > = true> |
| function (L func) noexcept |
| Lambda function constructor.
|
|
| function (R(*func)(A...)) noexcept |
| Free function constructor.
|
|
| function (std::nullptr_t) noexcept |
| Null function constructor.
|
|
| function (uint64_t id, std::function< R(A...)> func) noexcept |
| std::function constructor
|
|
constexpr bool | is_null () const noexcept |
| Returns true if this instance does not hold a callable target function, i.e.
|
|
constexpr bool | is_target_trivially_copyable () const noexcept |
| Returns true if the underlying target function is TriviallyCopyable .
|
|
constexpr | operator bool () const noexcept |
| Returns true if this instance holds a callable target function, i.e.
|
|
constexpr bool | operator!= (const function< R(A...)> &rhs) const noexcept |
|
constexpr R | operator() (A... args) |
|
constexpr R | operator() (A... args) const |
|
function & | operator= (const function &o) noexcept=default |
|
function & | operator= (function &&o) noexcept=default |
|
constexpr bool | operator== (const function< R(A...)> &rhs) const noexcept |
|
jau::type_info | signature () const noexcept |
| Returns signature of this function prototype R(A...) w/o underlying target function object.
|
|
constexpr size_t | size () const noexcept |
| Return the total size of this instance, may include heap allocated by delegate for bigger target functions.
|
|
constexpr size_t | target_size () const noexcept |
| Returns the size of underlying target function.
|
|
std::string | toString () const |
| Return a string representation of this instance.
|
|
constexpr func::target_type | type () const noexcept |
| Return the jau::func::type of this instance.
|
|
template<typename R, typename... A>
class jau::final_opt< R, A >
Class template jau::function is a general-purpose static-polymorphic function wrapper.
See Function Overview.
- Template Parameters
-
R | function return type |
A | function arguments |
- See also
- Function Overview
-
Function Usage
Definition at line 1253 of file functional.hpp.
template<typename R, typename... A>
template<typename I>
jau::final_opt< R, A >::function |
( |
const I & | data, |
|
|
R(* | func )(I &, A...) ) |
|
inlinenoexcept |
Capture by value (copy) function constructor.
Constructs an instance by copying the captured value and the given non-void function to an anonymous function using func::capval_target_t.
const I& data
will be copied into func::capval_target_t and hence captured by-copy.
The function invocation will have the reference of the copied data being passed to the target function for efficiency.
- Template Parameters
-
I | typename holding the captured data used by the function |
- Parameters
-
data | data type instance holding the captured data |
func | function with R return value and A... arguments. |
- See also
- function Overview
-
function Usage
Definition at line 1408 of file functional.hpp.
template<typename R, typename... A>
template<typename I>
Capture by value (move) function constructor.
Constructs an instance by moving the captured value and copying the given non-void function to an anonymous function using func::capval_target_t.
I&& data
will be moved into func::capval_target_t.
The function invocation will have the reference of the moved data being passed to the target function for efficiency.
- Template Parameters
-
I | typename holding the captured data used by the function |
- Parameters
-
data | data type instance holding the captured data |
func | function with R return value and A... arguments. |
- See also
- function Overview
-
function Usage
Definition at line 1430 of file functional.hpp.
template<typename R, typename... A>
template<typename I>
jau::final_opt< R, A >::function |
( |
I * | data_ptr, |
|
|
R(* | func )(I *, A...) ) |
|
inlinenoexcept |
Capture by-reference function constructor.
Constructs an instance by passing the captured reference (pointer) to the value and non-void function to an anonymous function using func::capref_target_t.
The function invocation will have the reference of the data being passed to the target function.
- Template Parameters
-
I | typename holding the captured data used by the function |
- Parameters
-
data_ptr | data type reference to instance holding the captured data |
func | function with R return value and A... arguments. |
- See also
- function Overview
-
function Usage
Definition at line 1450 of file functional.hpp.
template<typename R, typename... A>
jau::final_opt< R, A >::function |
( |
uint64_t | id, |
|
|
std::function< R(A...)> | func ) |
|
inlinenoexcept |
std::function constructor
Constructs an instance by copying the std::function to an anonymous function using func::std_target_t.
Notable, instance is holding the given unique uint64_t identifier to allow implementing the equality operator w/o RTTI, not supported by std::function.
- Parameters
-
func | free-function with R return value and A... arguments. |
- See also
- function Overview
-
function Usage
Definition at line 1468 of file functional.hpp.