Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-08-24 08:17:54


I think that means the result needs to fit in the enum type, but it doesn't
mean the result type is an enum. In fact, I think you get some integer type
unless you overload operator|() for your particular enum type.

-Dave
----- Original Message -----
From: "Branko Èibej" <branko.cibej_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, August 24, 2000 8:27 AM
Subject: Re: [boost] Review: Regular Expression Library

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