forked from phisko/kengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseFunction.hpp
More file actions
31 lines (23 loc) · 739 Bytes
/
Copy pathBaseFunction.hpp
File metadata and controls
31 lines (23 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include "reflection.hpp"
#include "function.hpp"
#ifndef KENGINE_FUNCTION_MAX_SIZE
# define KENGINE_FUNCTION_MAX_SIZE 64
#endif
namespace kengine {
namespace functions {
template<typename>
struct BaseFunction;
template<typename Ret, typename ... Args>
struct BaseFunction<Ret(Args...)> {
putils::function<Ret(Args...), KENGINE_FUNCTION_MAX_SIZE> func;
bool operator==(nullptr_t) const { return func == nullptr; }
bool operator!=(nullptr_t) const { return func != nullptr; }
Ret operator()(Args... args) const { return func(args...); }
Ret call(Args ... args) const { return func(args...); }
putils_reflection_attributes(
putils_reflection_attribute(&BaseFunction::func)
);
};
}
}