C++ macro “if class is defined”

前端 未结 5 1924
孤独总比滥情好
孤独总比滥情好 2020-12-19 01:59

Is there such macro in C++ (cross-compiler or compiler-specific):

#if isclass(NameSpace::MyClass)

Would be useful.

5条回答
  •  梦毁少年i
    2020-12-19 02:13

    If you do not care about portability, the __if_exists statement in VC++ meets your needs.

提交回复
热议问题