Boost logo

Boost :

Subject: Re: [boost] [core] Breaking bugfix in scoped enums
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2014-06-07 10:42:30


Le 07/06/14 11:37, Andrey Semashev a écrit :
> On Saturday 07 June 2014 11:02:12 Vicente J. Botet Escriba wrote:
>> Thanks Peter I don't know to what I was thinking :(
>> An enum (scoped or not) is always implicitly convertible to its
>> underlying type.
> Scoped enums must not implicitly convert to integers, be that underlying type
> or not. See 7.2/9 [dcl.enum].
Right. Sorry for the noise.
>
>> Andrey, why this implicit conversion must be removed? What is wrong with it?
>>
>> - operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); }
>>
>> I have added the line you removed and all the test pass. Which case need
>> to remove this implicit conversion?
> As I said, scoped_enum_compile_fail_conv_to_int.cpp test fails (i.e. it
> compiles while it shouldn't).
>
>
>
Sorry, I missed it.

Thanks for all, the fixes, and the tests.
Vicente


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