Boost logo

Boost Users :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-10-06 06:19:17


"nagual" <nagual_at_[hidden]> wrote:
> Hello, All!
>
> I write simple code:
> =============mpl_enum.cpp=============
> #include <boost/mpl/range_c.hpp>
> #include <boost/mpl/for_each.hpp>
> #include <iostream>
>
> enum test_e {ONE, TWO, THREE};
>
> void f(test_e e) {
> const char* names[] = {"ONE", "TWO", "THREE"};
> std::cout<<names[e]<<std::endl;
> }
>
> typedef boost::mpl::range_c<
> test_e, ONE, static_cast<test_e>(THREE + 1)
> > range;
>
> int main() {
> boost::mpl::for_each<range>(f);
> return 0;
> }
>
> =============mpl_enum.cpp=============
>
> MSVC 7 (ver 13.00.9466)
> =============Command Line==============
> c:\cl /EHsc /GR /Zc:wchar_t /Zc:forScope /nologo mpl_enum.cpp
> =============Command Line==============
> =============Output=====================
> mpl_enum.cpp
> C:\Lang\Projects\boost\boost\mpl\aux_\integral_wrapper.hpp(78) : error
> C2440: 'return' : cannot convert from '' to 'test_e'
> Conversion to enumeration type requires an explicit cast
> (static_cast, C-style cast or function-style cast)

[snip more errors]

Hmm, looks like a bug to me. Fixed in the CVS main trunk (the diffs are
attached, in case you would like to fix it locally - currently it takes up
to 24 hours for anonymous CVS servers to reflect the changes).

Thanks for the report!

Aleksey




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net