On Wed, 10 Jun 1998, holotko wrote:
> Are straightforward user defined enumerated data types permissible in
> gcc/g++.
> For example if I wished to declare:
>
> enum boolean {true, false};
>
> so that I can use the defined data type "boolean", as a return type for
> overloaded operator function of a class. Upon trying to accomplish this
> the compiler generates a series of obscure errors, parse errors, etc.
typedef enum {false, true} boolean;
Or perhaps to make it clearer for you:
enum boolean_enum {false, true};
typedef enum boolean_enum boolean;
I'm pretty sure C++ has a builtin bool or boolean type, though.
-- Elliot
When I die, I want to die peacefully in my sleep like my grandfather...
...not yelling and screaming like the people in the back of the
plane he was flying.