宏定义

1.想让你的代码别人读不懂 (使用宏定义)

2.想让你的代码简洁大方(使用宏定义)

尤其是10几个类 使用同几个函数的名称的时候(可见mfc框架使用了大量的宏定义)

 

形如:

#define HONG_FUNCTION(Key, Name) \
    std::string get_mod_key() override { return Key; } \
    std::wstring get_mod_name() override { return Name; }

#endif 

 

posted on 2020-03-04 14:05  lydstory  阅读(178)  评论(0)    收藏  举报

导航