Boost logo

Boost :

From: Branko Èibej (branko.cibej_at_[hidden])
Date: 2000-08-24 07:27:06


John Maddock wrote:
> BTW what happens if you OR together two enum values (note that the result
> will not be a valid enum)? Just curious...

It will be valid. 7.2 [dcl.enum] says:

  6 For an enumeration where e_min is the smallest enumerator and e_max
    is the largest, the values of the enumeration are the values of the
    underlying type in the range b_min to b_max, where b_min and b_max
    are, respectively, the smallest and largest values of the smallest
    bit-field that can store e_min and e_max. It is possible to define
    an enumeration that has values not defined by any of its enumerators.

AFAIK the intent of that paragraph is to make OR-ing enumerators
yield a defined enumeration value.

    Brane

-- 
Branko Èibej                 <branko.cibej_at_[hidden]>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 1) 586 53 49     fax: (+386 1) 586 52 70

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk