#include <iostream>
using namespace std;
class Seq
{
public:
Seq(){ cout<<"Seq::constructor()...."<<endl; };
~Seq(){ cout<<"Seq::distructor()...."<<endl; };
void DoWork(){ cout<<"Seq::DoWork()...."<<endl; };
};
Seq* GetSeq(){ return new Seq(); }
#define BEGIN_COMMANDSEQUANCE(x) Seq* x= GetSeq();
#define END_COMMANDSEQUANCE(x) delete x;
int main(int argc, char* argv[])
{
BEGIN_COMMANDSEQUANCE(seq);
seq->DoWork();
END_COMMANDSEQUANCE(seq);
return 0;
}
C++里 宏 的一些特别用法(一)
最新推荐文章于 2021-08-19 16:57:15 发布