nngn
Loading...
Searching...
No Matches
nngn::delegate< F, Args > Class Template Reference

Static container for a callable and its arguments. More...

#include <delegate.h>

Inheritance diagram for nngn::delegate< F, Args >:
Collaboration diagram for nngn::delegate< F, Args >:

Public Member Functions

 delegate (const delegate &)=delete
 
delegateoperator= (const delegate &)=delete
 
 delegate (delegate &&) noexcept=default
 
delegateoperator= (delegate &&) noexcept=default
 
 delegate (void)=default
 
 ~delegate (void)=default
 
 delegate (Args ...a)
 
 delegate (F f)
 
 delegate (F f, Args ...a)
 
 operator() ()
 
template<size_t n>
 arg () const
 
template<size_t n>
 arg ()
 

Private Attributes

std::tuple< Args... > args = {}
 

Static Private Attributes

static constexpr bool has_args = sizeof...(Args)
 

Detailed Description

template<typename F, typename ... Args>
class nngn::delegate< F, Args >

Static container for a callable and its arguments.

Unlike std::function, the type of the callable is fixed and not erased, so it can be fully optimized.

Constructor & Destructor Documentation

◆ delegate() [1/6]

template<typename F , typename ... Args>
nngn::delegate< F, Args >::delegate ( const delegate< F, Args > & )
delete

◆ delegate() [2/6]

template<typename F , typename ... Args>
nngn::delegate< F, Args >::delegate ( delegate< F, Args > && )
defaultnoexcept

◆ delegate() [3/6]

template<typename F , typename ... Args>
nngn::delegate< F, Args >::delegate ( void )
default

◆ ~delegate()

template<typename F , typename ... Args>
nngn::delegate< F, Args >::~delegate ( void )
default

◆ delegate() [4/6]

template<typename F , typename ... Args>
nngn::delegate< F, Args >::delegate ( Args ... a)
inlineexplicit

◆ delegate() [5/6]

template<typename F , typename ... Args>
nngn::delegate< F, Args >::delegate ( F f)
inlineexplicit

◆ delegate() [6/6]

template<typename F , typename ... Args>
nngn::delegate< F, Args >::delegate ( F f,
Args ... a )
inline

Member Function Documentation

◆ arg() [1/2]

template<typename F , typename ... Args>
template<size_t n>
nngn::delegate< F, Args >::arg ( )
inline

◆ arg() [2/2]

template<typename F , typename ... Args>
template<size_t n>
nngn::delegate< F, Args >::arg ( ) const
inline

◆ operator()()

template<typename F , typename ... Args>
nngn::delegate< F, Args >::operator() ( )
inline

◆ operator=() [1/2]

template<typename F , typename ... Args>
delegate & nngn::delegate< F, Args >::operator= ( const delegate< F, Args > & )
delete

◆ operator=() [2/2]

template<typename F , typename ... Args>
delegate & nngn::delegate< F, Args >::operator= ( delegate< F, Args > && )
defaultnoexcept

Member Data Documentation

◆ args

template<typename F , typename ... Args>
std::tuple<Args...> nngn::delegate< F, Args >::args = {}
private

◆ has_args

template<typename F , typename ... Args>
bool nngn::delegate< F, Args >::has_args = sizeof...(Args)
staticconstexprprivate

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