diff options
Diffstat (limited to 'src/kernel/NeKit/Function.h')
| -rw-r--r-- | src/kernel/NeKit/Function.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/kernel/NeKit/Function.h b/src/kernel/NeKit/Function.h index 1ceda345..2889e055 100644 --- a/src/kernel/NeKit/Function.h +++ b/src/kernel/NeKit/Function.h @@ -16,28 +16,24 @@ namespace Kernel { template <typename T, typename... Args> class Function final { public: - Function() = default; - - public: - explicit Function(T (*Fn)(Args... args)) : fFn(Fn) {} - + Function() = delete; + Function(nullPtr) = delete; ~Function() = default; - Function& operator=(const Function&) = default; - Function(const Function&) = default; + explicit Function(T (*Fn)(Args... args)) : fFn(Fn) { MUST_PASS(fFn); } + + Function& operator=(const Function&) = delete; + Function(const Function&) = delete; - template <typename... XArgs> T operator()(Args&&... args) { return fFn(args...); } - template <typename... XArgs> T Call(Args&&... args) { return fFn(args...); } - operator bool() { return fFn; } - + explicit operator bool() { return fFn; } bool operator!() { return !fFn; } private: |
