#include "iostream"
#include "string.h"
using namespace std;
template<typename Type>
class Test {
public:
void PrintHello() {
cout << "Hello" << endl;
}
};
#define GetPersonClassName(name)\
public: \
void Get##name##Name() {\
cout << "gwx" << endl;\
}\
Test<name> GetTest() {\
return test##name;\
}\
private:\
Test<name> test##name;\
struct GWX {
string name;
};
class PersonClass {
GetPersonClassName(GWX);
};
int main() {
PersonClass gwx;
gwx.GetTest().PrintHello();
return 0;
}
C++ 宏使用进阶
猜你喜欢
转载自blog.csdn.net/qqQQqsadfj/article/details/134573125
今日推荐
周排行