projects
/
cdsspec-compiler.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
more
[cdsspec-compiler.git]
/
test.cc
1
#include <stdio.h>
2
#include <stdlib.h>
3
//#include "test.h"
4
5
typedef void (*action_t)();
6
7
void bar() {
8
printf("In bar\n");
9
}
10
11
template <typename T, action_t val, int b>
12
class Class {
13
public:
14
static T arr;
15
struct A {
16
int &a;
17
};
18
19
static void action() {
20
printf("%d\n", arr);
21
}
22
23
action_t getFuncPtr() {
24
foo();
25
action();
26
return &Class::action;
27
}
28
29
static void foo() {
30
31
}
32
33
static void init() {
34
action_t inst1 = &foo;
35
int a = (1, 2);
36
}
37
38
Class() {
39
//ar = T((int)val);
40
(*val)();
41
//foo();
42
}
43
};
44
45
#include "test.h"
46
47
int main() {
48
Class<int> c;
49
action_t f_ptr = c.getFuncPtr();
50
//cc.getFuncPtr();
51
return 1;
52
}
53