怎样把宏改为类或者函数?解决方法
怎样把宏改为类或者函数?
请问哪里有这样的例子,把宏改为类或者函数的? 现在有一段老的代码,想改写为类,请大家指点, 在线等!非常感谢!!
#define START_EXPLAIN \
private: \
static void explain_macro() \
{
////////////////////////////////////////////////////////////////////////
#define EXPLAIN(line){ \
std::string anStr(line); \
CPPUNIT::GlobalListener::instance()-> addInfo( "EXPLAIN ", anStr.c_str()); \
}
////////////////////////////////////////////////////////////////////////
#define END_EXPLAIN \
} \
public:
////////////////////////////////////////////////////////////////////////
#define START_TEST(method) \
private: \
请问哪里有这样的例子,把宏改为类或者函数的? 现在有一段老的代码,想改写为类,请大家指点, 在线等!非常感谢!!
#define START_EXPLAIN \
private: \
static void explain_macro() \
{
////////////////////////////////////////////////////////////////////////
#define EXPLAIN(line){ \
std::string anStr(line); \
CPPUNIT::GlobalListener::instance()-> addInfo( "EXPLAIN ", anStr.c_str()); \
}
////////////////////////////////////////////////////////////////////////
#define END_EXPLAIN \
} \
public:
////////////////////////////////////////////////////////////////////////
#define START_TEST(method) \
private: \