diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
| commit | da70596895d8135e08f8caac6978117697b4c021 (patch) | |
| tree | 2516785b5434df8453687f05dc8dd877438901ab /dev/Kernel/NewKit/Function.hxx | |
| parent | 005de79004c9d30e64bdee6e14e06f9d47d1f2ab (diff) | |
[REFACTOR]
Improved project structure.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/NewKit/Function.hxx')
| -rw-r--r-- | dev/Kernel/NewKit/Function.hxx | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/dev/Kernel/NewKit/Function.hxx b/dev/Kernel/NewKit/Function.hxx deleted file mode 100644 index e54ff456..00000000 --- a/dev/Kernel/NewKit/Function.hxx +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _INC_FUNCTION_HPP__ -#define _INC_FUNCTION_HPP__ - -#include <NewKit/Defines.hxx> - -namespace Kernel -{ - template <typename T, typename... Args> - class Function final - { - public: - Function() = default; - - public: - explicit Function(T (*Fn)(Args... args)) - : fFn(Fn) - { - } - - ~Function() = default; - - Function& operator=(const Function&) = default; - Function(const Function&) = default; - - template <typename... XArgs> - T operator()(Args... args) - { - return fFn(args...); - } - - template <typename... XArgs> - T Call(Args... args) - { - return fFn(args...); - } - - operator bool() - { - return fFn; - } - - bool operator!() - { - return !fFn; - } - - private: - T(*fFn) - (Args... args); - }; -} // namespace Kernel - -#endif // !_INC_FUNCTION_HPP__ |
