c7cb0dbc48e523b6d2070028ca5d55f8ba060d45
[cdsspec-compiler.git] / test.cc
1 #include <stdio.h>
2 #include <iostream>
3 #include <vector>
4
5 using namespace std;
6
7
8 template<typename T>
9 class A {
10         private:
11         int outer;
12         class B {
13                 private:
14                         vector<int> v;
15                         T str;
16                 public:
17                         typedef struct C {
18                                 T x;
19                         } C_t;
20
21                         enum interface_t {put, get};
22                         B() {
23                                 v = vector<int>();
24                                 str = "abc";
25
26                         }
27
28                         void _pushBack(int a) {
29                                 cout << str << endl;
30                                 v.push_back(a);
31                         }
32
33                         int _size() {
34                                 return v.size();
35                         }
36
37                         C_t func() {
38                                 char *cStr = "struct_ab";
39                                 C_t c;
40                                 c.x = cStr;
41                                 return c;
42                         }
43         } b;
44
45         public:
46         A() {
47         }
48         
49         void pushBack(int a) {
50                 //printf("Size: %d\n", b.size());
51                 b._pushBack(a);
52                 //printf("Size: %d\n", b.size());
53         }
54
55         int size() {
56                 //B<T>::interface_t inter;
57                 struct B::C_t c = b.func();
58                 enum B::interface_t a = B::put;
59                 vector<enum B::interface_t> ve(3);
60                 ve.push_back(B::put);
61                 cout << "Size: " << ve.size() << endl;
62                 cout << b.func().x << endl;
63                 return b._size();
64         }
65 };
66
67 int main() {
68         #define __COND_SAT__ a.size()
69         A<string> a;
70         a.pushBack(1);
71         if (__COND_SAT__ != 0) {
72                 cout << "Size greater than 0" << endl;
73         }
74         #undef __COND_SAT__
75
76         bool __COND_SAT__ = false;
77         if (!__COND_SAT__) {
78                 cout << "False!" << endl;
79         }
80         return 0;
81 }