Boost logo

Boost :

Subject: Re: [boost] [type_traits] is_enum on scoped enums doesn't works as expected
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-08-21 10:56:26


On 8/21/2011 5:26 AM, Vicente J. Botet Escriba wrote:
> Hi,
>
> The following file fails to compile under clang 2.9 c++0x
>
> #include <boost/static_assert.hpp>
> #include <boost/type_traits/is_enum.hpp>
>
> enum E {E_a,E_b,E_c};
> BOOST_STATIC_ASSERT((boost::is_enum<E>::value));
> enum class EC {a,b,c};
> BOOST_STATIC_ASSERT((boost::is_enum<EC>::value));
>
> //#include <type_traits>
>
> The command line and error is
>
> "/Users/viboes/clang/clang+llvm-2.9/bin/clang++" -x c++ -std=c++0x -O0
> -g -Wextra -Wno-long-long -pedantic -O0 -fno-inline -Wall -pedantic -g
> -DBOOST_ALL_NO_LIB=1 -DBOOST_CONVERSION_DOUBLE_CP
> -DBOOST_ENABLE_WARNINGS -I"." -I"../../.." -c -o
> "../../../bin.v2/libs/enums/test/is_enum_pass.test/clang-darwin-2.9x/debug/is_enum_pass.o"
> "enum_class/is_enum_pass.cpp"
>
> enum_class/is_enum_pass.cpp:7:1: error: static_assert failed
> "(boost::is_enum<EC>::value)"
> BOOST_STATIC_ASSERT((boost::is_enum<EC>::value));
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from enum_class/is_enum_pass.cpp:1:
>
> Am I missing something evident?
> Is this a known bug of is_enum?
>
> BTW, I have tried to use directly the type_traits standard file and my
> build configuration is unable to find it.
>
> enum_class/is_enum_pass.cpp:9:10: fatal error: 'type_traits' file not found
> #include <type_traits>

Normally this is:

#include <boost/type_traits.hpp>


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