Advertisement
WeltEnSTurm

Untitled

Jul 24th, 2011
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. template<typename T_ret, typename... T_args>
  2. class ClassFunction {
  3.         T_ret(*mFunc)(T_args...);
  4.     public:
  5.         ClassFunction(T_ret(*f)(T_args...)){
  6.             mFunc = f;
  7.         }
  8.         T_ret operator()(T_args... a){
  9.             return mFunc(a...);
  10.         }
  11. };
  12.  
  13. class SomeTestClass {
  14.     public:
  15.         ClassFunction<void> Hurr;
  16.         SomeTestClass():
  17.             Hurr([](){
  18.                 print("LAWL :3");
  19.             }){}
  20. };
  21.  
  22. int main(){
  23.     SomeTestClass test;
  24.     test.Hurr();
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement