following up a message from Wim Veldhuis to Jason Hendriks:
JH> enum boolean{false, true};
JH> True, but it's not possible for this enumerated type to have
JH> anything other than 0 or 1, isn't that right?
WV> Depends on the compiler settings. If you allow the compiler
WV> to treat enums as int, you're in trouble. I believe that for
WV> the inbuilt bool type zero is converted to false, everything
WV> else is converted to true.
WV> I do not have a compiler installed on my machine currently,
WV> so I cannot test it now. I'll try it tomorrow at work, and
WV> post the result.
Ok, I tried it with Borland C++ v5.01.
You get a warning when you are compiling with the Borland Extensions enabled,
and an error when ANSI compliance is set. Of course you can disable the
warning if you want, but where I work it is considered to be stupid to do so
:-).
So you were correct in noticing that I saw a problem which didn't really
exist.
mvg/wr
--- timEd/2 1.01.g3+
---------------
* Origin: LightHouse BBS ==> I am a H.U.G.O. Member ! (2:285/324.3)
|