C++ macro “if class is defined”

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

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

#if isclass(NameSpace::MyClass)

Would be useful.

5条回答
  •  情话喂你
    2020-12-19 02:05

    That's not possible, but you could use your include guard constant to verify that the class has been included.

提交回复
热议问题