
7 Jun
2014
7 Jun
'14
9:37 a.m.
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].
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).