|
Boost : |
From: Johan Johansson (johanj_at_[hidden])
Date: 2005-04-15 18:33:24
There may be an error in them. From
http://www.boost.org/more/int_const_guidelines.htm:
--- An integral constant expression can be one of the following: ... 2. An enumerator value. ... 9. The result of applying a binary operator to two integral constant expressions: INTEGRAL_CONSTANT1 op INTEGRAL_CONSTANT2 provided that the operator is not an assignment operator, or comma operator. --- Neither gcc (3.3.3) nor Metrowerks (don't remember version) seems to think that "enumVal1 | enumVal2" is an integral constant expression. This seems obvious in the case of operator| being overloaded, although Comeau online 4.3.3 *does* seem to swallow that without complaint, which greatly diminishes my expectations of being right and greatly adds to my confusion. However, gcc and Metrowerks seem to ban this even if operator| is not overloaded. I haven't found the standardese to motivate that yet. Someone set me straight, please! Thanks, Johan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk