//Define macro ============ #define mcr_defineVar(t,v) t v; //Use====================== mcr_defineVar(int,a); //same as int a; a = 10; // =>a = 10;
mcr_defineVar("int",a);
mcr_defineVar("int","a");
int a;
// Helper macro BOOST_JOIN: // The following piece of macro magic joins the two // arguments together, even when one of the arguments is // itself a macro (see 16.3.1 in C++ standard). The key // is that macro expansion of macro arguments does not // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN. // #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y ) #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) #define BOOST_DO_JOIN2( X, Y ) X##Y
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)