Mail Archives: djgpp/1998/06/16/14:31:31
Eli Zaretskii wrote:
---snip---
> Also, I strongly suspect that the type of an expression "a|b" is an
> int, regardless of its value. (Could any ANSI guru please confirm
> this?)
Yes, I C++ it does, and I expect in C also. Almost all operations on
enums produce ints. Except of course when there global operators in
scope like this:
enumtype operator|(const enumtype one, const enumtype two)
{
return enumtype((int)one|(int)two));
}
There is a big thread in comp.lang.c++.moderated called 'C++ and enums'
which discuss this. Go find it on dejanews.
Hope this helps,
Doug Eleveld
- Raw text -