Refureku v2.2.0
C++17 runtime reflection library.
NonMemberFunction.h
1
8#pragma once
9
10#include <utility> //std::forward
11
12#include "Refureku/TypeInfo/Functions/ICallable.h"
13
14namespace rfk
15{
16 template <typename FunctionPrototype>
18
19 template <typename ReturnType, typename... ArgTypes>
20 class NonMemberFunction<ReturnType(ArgTypes...)> : public ICallable
21 {
22 private:
23 using FunctionPrototype = ReturnType (*)(ArgTypes...);
24
26 FunctionPrototype _function = nullptr;
27
28 public:
29 template <typename Functor>
30 NonMemberFunction(Functor f) noexcept;
31
32 NonMemberFunction(FunctionPrototype function) noexcept;
33
39 FunctionPrototype getFunctionHandle() const noexcept;
40
48 ReturnType operator()(ArgTypes&&... args) const;
49 };
50
51 #include "Refureku/TypeInfo/Functions/NonMemberFunction.inl"
52}
Definition: ICallable.h:13
FunctionPrototype getFunctionHandle() const noexcept
Get a pointer to the underlying function.
Definition: NonMemberFunction.h:17
Definition: Allocator.h:16