nngn
Loading...
Searching...
No Matches
nngn::delegate_fn< F > Class Template Reference

Unique type for a function or member function pointer. More...

#include <delegate.h>

Inheritance diagram for nngn::delegate_fn< F >:
Collaboration diagram for nngn::delegate_fn< F >:

Public Member Functions

template<typename ... Ts>
requires (invocable<Ts...>)
 operator() (Ts &&...ts)
 Calls F.
 

Private Types

using base = std::integral_constant<value_type, F>
 

Private Attributes

using value_type
 

Static Private Attributes

template<typename ... Ts>
static constexpr bool invocable = std::is_invocable_v<value_type, Ts...>
 

Detailed Description

template<function_pointer auto F>
class nngn::delegate_fn< F >

Unique type for a function or member function pointer.

The pointer is fully preserved and not converted to a generic function pointer, so that the call through operator()() can be fully optimized. Being a unique type for each pointer value, it can be used where callable types are required (e.g. for nngn::delegate).

Template Parameters
FA function or member function pointer.

Member Typedef Documentation

◆ base

template<function_pointer auto F>
using nngn::delegate_fn< F >::base = std::integral_constant<value_type, F>
private

Member Function Documentation

◆ operator()()

template<function_pointer auto F>
template<typename ... Ts>
requires (invocable<Ts...>)
nngn::delegate_fn< F >::operator() ( Ts &&... ts)
inline

Calls F.

See also
std::invoke

Member Data Documentation

◆ invocable

template<function_pointer auto F>
template<typename ... Ts>
bool nngn::delegate_fn< F >::invocable = std::is_invocable_v<value_type, Ts...>
staticconstexprprivate

◆ value_type

template<function_pointer auto F>
using nngn::delegate_fn< F >::value_type
private

The documentation for this class was generated from the following file: