// 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() virtual _F_foo_func1( )=0; #define _F_foo_func2(x) void x func2() virtual _F_foo_func2( )=0; }; void foo (_F_foo &c) { c.func1(); c.func2(); } static void f (int &refval, int val, const char *title,vector &tb) { glocal refval; glocal val; glocal title; glocal int a=1; glocal tb; (); printf ("This is func1 glocal.a=%d\n",glocal.a); glocal.tb.push_back("func1"); 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; }