1#ifndef NNGN_UTILS_DELEGATE_H
2#define NNGN_UTILS_DELEGATE_H
22template<function_po
inter auto F>
25 using base = std::integral_constant<value_type, F>;
26 template<
typename ...Ts>
31 template<
typename ...Ts>
33 return std::invoke(F,
FWD(ts)...);
42template<
typename F,
typename ...Args>
44 static constexpr bool has_args =
sizeof...(Args);
45 [[no_unique_address]] std::tuple<Args...>
args = {};
53 decltype(
auto)
operator()()
54 {
return std::apply(
static_cast<F&
>(*
this), this->
args); }
56 decltype(
auto)
arg()
const {
return std::get<n>(this->
args); }
58 decltype(
auto)
arg() {
return std::get<n>(this->
args); }
Unique type for a function or member function pointer.
Definition delegate.h:23
typedef value_type
Definition delegate.h:24
std::integral_constant< value_type, F > base
Definition delegate.h:25
static constexpr bool invocable
Definition delegate.h:27
Static container for a callable and its arguments.
Definition delegate.h:43
static constexpr bool has_args
Definition delegate.h:44
std::tuple< Args... > args
Definition delegate.h:45
delegate(F f, Args ...a)
Definition delegate.h:52
arg() const
Definition delegate.h:56
arg()
Definition delegate.h:58
delegate(F f)
Definition delegate.h:51
#define F(...)
Definition pp.cpp:12
move
Definition camera.lua:57
#define FWD(...)
Definition utils.h:18
#define NNGN_MOVE_ONLY(x)
Definition utils.h:39