I\'m getting \"error: expected \'}\'\"
where the \'^\' is pointing when I compile in the following C++ source:
typedef enum { false, true } Boolean;
The true
and false
are keywords in C++. You cannot use them in enum identifiers.
As it is said in the standard :
2.12 Keywords [lex.key]
The identifiers shown in Table 4 are reserved for use as keywords (that is, they are unconditionally treated as keywords in phase 7) except in an attribute-token.
In table 4:
false ... true
In C, they are not keywords, your code should work but the best should be to include
who already defines true
and false
then you don't need to define them by yourself.