In C/C++, is there a directive similar to #ifndef for typedefs?

后端 未结 11 2236
太阳男子
太阳男子 2020-12-15 16:03

If I want to define a value only if it is not defined, I do something like this :

#ifndef THING
#define THING OTHER_THING
#endif

What if

11条回答
  •  既然无缘
    2020-12-15 16:18

    It is not transparent but you can try to compile it one time without typedef (just using the alias), and see if it compiles or not.

提交回复
热议问题