Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2006-03-13 15:51:15

--- Boris Gubenko <Boris.Gubenko_at_[hidden]> wrote:

> The compiler is correct. Instead of quoting C++ Standard, I'll quote
> Lippman C++ Primer, 3rd edition, p.113:
> An object of an enumeration type can be be initialized and
> assigned only with another object of the same enumeration
> type or with one of its set of enumerators. For example,
> although 3 is a legal value associated with Points, it cannot
> be explicitly assigned to a Points object:
> [...]
> enum Points { point2d = 2, point2w, point3d = 3, point3w };
> // error: pt2w initialized with int
> Points pt2w = 3;


> Btw, you'd get the same compilation error with any EDG-based
> compiler. On Tru64, for example:

Indeed. I have the same compiler. I should have checked before.

Obviously I've reduced the problem a bit too much.

Boost.Python (with the very same boost version from CVS) compiles fine with the
Tru64 cxx compiler, but aCC gives this error (fragment of output):

aCC -o boost/libs/python/src/converter/builtin_converters.o -c -AA +W2837
-DBOOST_PYTHON_SOURCE -I/home1/tmaier/dist/boost -Ipython/include/python2.4
"boost/boost/mpl/aux_/integral_wrapper.hpp", line 45: error #2144: a value of
type "long" cannot be used to initialize an entity of type "const
          detected during:
            instantiation of class "mpl_::integral_c<T, N> [with
T=boost::numeric::udt_builtin_mixture_enum, N=0L]" at line 30 of
The full output is here:

The problem can be reduced like this:

#include <boost/numeric/conversion/cast.hpp>

unsigned long long
  return boost::numeric_cast<unsigned long long, long>(0L);

This compiles with Tru64 cxx:

% cxx -std strict_ansi -c -I$dist/boost numeric_cast.cpp
cxx: Warning: numeric_cast.cpp, line 3: the type "long long" is nonstandard
unsigned long long
cxx: Warning: numeric_cast.cpp, line 6: the type "long long" is nonstandard
  return boost::numeric_cast<unsigned long long, long>(0L);

But not with aCC:

Could this be fixed with a few extra #ifdefs?


BTW: Is the aCC compiler somehow related to the Tru64 compiler?

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

Boost list run by bdawes at, gregod at, cpdaniel at, john at