// Very simple code to understand how tlcc works // and test the new reference system #include #include #include using namespace std; #define _TLMP_foo struct _F_foo{ #define _F_foo_func1(x) void x func1(vector &t) virtual _F_foo_func1( )=0; #define _F_foo_func2(x) void x func2(vector &t) virtual _F_foo_func2( )=0; }; void foo (_F_foo &c, vector &t) { c.func1(t); c.func2(t); } static void f (int &refval, int val, const char *title,vector &tb) { glocal refval; glocal val; glocal title; glocal int a=1; glocal tb; (tb); printf ("This is func1 glocal.a=%d\n",glocal.a); glocal.tb.push_back("func1"); glocal t; (t); glocal.t.push_back("sub-func1"); glocal.t.push_back("sub-func2"); glocal.refval++; printf ("This is func2, val=%d title=%s\n",glocal.val,glocal.title); glocal.tb.push_back("func2"); glocal.refval++; } int main () { vector tb; int val=10; f (val,1,"this is the title",tb); printf ("val=%d\n",val); for (auto const &s:tb) printf ("tb[]=%s\n",s.c_str()); return 0; }