more
[cdsspec-compiler.git] / test.cc
diff --git a/test.cc b/test.cc
index b9b6ed37cc09c97281a9fa8a31c0165e95da042c..b6707b90c56417a2b417e5675e9c9f2ac923ac5f 100644 (file)
--- a/test.cc
+++ b/test.cc
@@ -1,28 +1,53 @@
 #include <stdio.h>
+#include <stdlib.h>
+//#include "test.h"
 
-typedef void (*action_t)(void*);
+typedef void (*action_t)();
 
+void bar() {
+       printf("In bar\n");
+}
+
+template <typename T, action_t val, int b>
 class Class {
        public:
+       static T arr;
        struct A {
                int &a;
        };
+
+       static void action() {
+               printf("%d\n", arr);
+       }
+
+       action_t getFuncPtr() {
+               foo();
+               action();
+               return &Class::action;
+       }
        
-       void action(void *info) {
-               printf("abc\n");
+       static void foo() {
+
+       }
+
+       static void init() {
+               action_t inst1 = &foo;
+               int a = (1, 2);
        }
 
        Class() {
-               action_t inst = (action_t) &Class::action;
-               //(*inst)(NULL);
+               //ar = T((int)val);
+               (*val)();
+               //foo();
        }
 };
 
+#include "test.h"
+
 int main() {
-       Class a;
-       Class &b = a;
-       Class *c = &b;
-       printf("%d\n", &b);
-       printf("%d\n", &c);
+       Class<int> c;
+       action_t f_ptr = c.getFuncPtr();
+       //cc.getFuncPtr();
        return 1;
 }
+