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.
 
template<typename ... Ts>
requires (invocable<Ts...>)
 operator() (Ts &&...ts)
 Calls F.
 

Private Types

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

Static Private Member Functions

template<typename ... Ts>
static constexpr bool invocable
 

Private Attributes

using value_type = typedef
 

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 [1/2]

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

◆ base [2/2]

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

Member Function Documentation

◆ invocable()

template<function_pointer auto F>
template<typename ... Ts>
static constexpr bool nngn::delegate_fn< F >::invocable
staticconstexprprivate

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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>
constexpr bool nngn::delegate_fn< F >::invocable = std::is_invocable_v<value_type, Ts...>
staticconstexprprivate

◆ value_type

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

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