template <size_t inline_target_size, bool require_inline, typename Allocator, typename Result, typename... Args>

class function_impl

Defined at line 186 of file ../../sdk/lib/fit/include/lib/fit/function.h

Public Methods

void function_impl<inline_target_size, require_inline, Result (Args...), Allocator> ()

Initializes an empty (null) function. Attempting to call an empty

function will abort the program.

Defined at line 217 of file ../../sdk/lib/fit/include/lib/fit/function.h

void function_impl<inline_target_size, require_inline, Result (Args...), Allocator> (decltype(nullptr) )

Creates a function with an empty target (same outcome as the default

constructor).

Defined at line 221 of file ../../sdk/lib/fit/include/lib/fit/function.h

void function_impl<inline_target_size, require_inline, Result (Args...), Allocator> (Result (*)(Args...) function_target)

Creates a function bound to the specified function pointer.

If target == nullptr, assigns an empty target.

Defined at line 225 of file ../../sdk/lib/fit/include/lib/fit/function.h

template <typename Callable, requires_conditions<
                                    std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
                                                        result_type>,
                                    not_self_type<Callable>> = true>
void function_impl<inline_target_size, require_inline, Result (Args...), Allocator> (Callable && function_target)

Creates a function bound to the specified callable object.

If target == nullptr, assigns an empty target.

For functors, we need to capture the raw type but also restrict on the

existence of an appropriate operator () to resolve overloads and implicit

casts properly.

Note that specializations of this template method that take fit::callback

objects as the target Callable are deleted (see below).

Defined at line 241 of file ../../sdk/lib/fit/include/lib/fit/function.h

template <size_t other_inline_target_size, bool other_require_inline, typename OtherAllocator>
void function_impl<inline_target_size, require_inline, Result (Args...), Allocator> (::fit::callback_impl<other_inline_target_size, other_require_inline, Result (Args...), OtherAllocator> )

Deletes the specializations of function_impl(Callable) that would allow

a |fit::function| to be constructed from a |fit::callback|. This prevents

unexpected behavior of a |fit::function| that would otherwise fail after

one call. To explicitly allow this, simply wrap the |fit::callback| in a

pass-through lambda before passing it to the |fit::function|.

Defined at line 249 of file ../../sdk/lib/fit/include/lib/fit/function.h

void function_impl<inline_target_size, require_inline, Result (Args...), Allocator> (function_impl<inline_target_size, require_inline, Result (Args...), Allocator> && other)

Creates a function with a target moved from another function,

leaving the other function with an empty target.

Defined at line 254 of file ../../sdk/lib/fit/include/lib/fit/function.h

void ~function_impl<inline_target_size, require_inline, Result (Args...), Allocator> ()

Destroys the function, releasing its target.

Defined at line 257 of file ../../sdk/lib/fit/include/lib/fit/function.h

function_impl<inline_target_size, require_inline, Result (Args...), Allocator> & operator= (decltype(nullptr) )

Assigns the function to an empty target. Attempting to invoke the

function will abort the program.

Defined at line 261 of file ../../sdk/lib/fit/include/lib/fit/function.h

template <typename Callable>
assignment_requires_conditions<std::is_convertible<decltype(std::declval<Callable &>()(std::declval<Args>()...)), result_type>, not_self_type<Callable>> operator= (Callable && function_target)

NOLINTNEXTLINE(misc-unconventional-assign-operator)

Defined at line 277 of file ../../sdk/lib/fit/include/lib/fit/function.h

template <size_t other_inline_target_size, bool other_require_inline, typename OtherAllocator>
function_impl<inline_target_size, require_inline, Result (Args...), Allocator> & operator= (::fit::callback_impl<other_inline_target_size, other_require_inline, Result (Args...), OtherAllocator> )

Deletes the specializations of operator=(Callable) that would allow

a |fit::function| to be assigned from a |fit::callback|. This

prevents unexpected behavior of a |fit::function| that would otherwise

fail after one call. To explicitly allow this, simply wrap the

|fit::callback| in a pass-through lambda before assigning it to the

|fit::function|.

Defined at line 292 of file ../../sdk/lib/fit/include/lib/fit/function.h

function_impl<inline_target_size, require_inline, Result (Args...), Allocator> & operator= (function_impl<inline_target_size, require_inline, Result (Args...), Allocator> && other)

Move assignment

Defined at line 296 of file ../../sdk/lib/fit/include/lib/fit/function.h

void swap (function_impl<inline_target_size, require_inline, Result (Args...), Allocator> & other)

Swaps the functions' targets.

Defined at line 304 of file ../../sdk/lib/fit/include/lib/fit/function.h

Result operator() (Args... args)

Invokes the function's target.

Aborts if the function's target is empty.

Defined at line 314 of file ../../sdk/lib/fit/include/lib/fit/function.h

function_impl<inline_target_size, require_inline, Result (Args...), Allocator> share ()

Returns a new function object that invokes the same target.

The target itself is not copied; it is moved to the heap and its

lifetime is extended until all references have been released.

Note: This method is not supported on |fit::inline_function

<

>|

because it may incur a heap allocation which is contrary to

the stated purpose of |fit::inline_function

<

>|.

Defined at line 323 of file ../../sdk/lib/fit/include/lib/fit/function.h

Friends

template <size_t inline_target_sizebool require_inlinetypename Allocatortypename Resulttypename... Args>
const void * function_impl<inline_target_sizerequire_inlineResult(Args...)Allocator> (const function_impl<inline_target_size, require_inline, Result (Args...), Allocator> & )