Reputation: 13575
For example
typedef float Real;
And want to check if Real is defined or not? For macro, it is easy
#define Real float
#ifndef Real
#define Real float
#endif
How about typedef?
Upvotes: 2
Views: 1401
Reputation: 145249
Any typedef
can be repeated (with the same definition), so you don't need to check if it already exists.
Caveat: old versions of g++ didn't quite following the standard's rules. The solution then, for the particular problem at hand then, was to generate probably unique identifiers.
Upvotes: 2