Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename T_ret, typename... T_args>
- class ClassFunction {
- T_ret(*mFunc)(T_args...);
- public:
- ClassFunction(T_ret(*f)(T_args...)){
- mFunc = f;
- }
- T_ret operator()(T_args... a){
- return mFunc(a...);
- }
- };
- class SomeTestClass {
- public:
- ClassFunction<void> Hurr;
- SomeTestClass():
- Hurr([](){
- print("LAWL :3");
- }){}
- };
- int main(){
- SomeTestClass test;
- test.Hurr();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement