Boost logo

Boost :

From: Dirk Gerrits (dirk_at_[hidden])
Date: 2002-09-15 10:27:20


I believe the example at
is broken. Intel's C++ Compiler 6.0 complains that iter
doesn't have a position member. (The real error message is
more cryptic of course. ;)

If this is true then I think the example should make use of
distance instead:

typedef mpl::vector<char,int,unsigned,long,unsigned long> types;
typedef mpl::find<types,unsigned>::type iter;
std::size_t const position =
  mpl::distance<mpl::begin<types>::type, iter>::type::value;
BOOST_STATIC_ASSERT(position == 2);

Additionally, when I change the "== 2" to "== 3" then code
still compiles! All I get is a:
main.cpp(18): warning #70: incomplete type is not allowed
  BOOST_STATIC_ASSERT(position == 3);
But no errors.

Is this a fault on my part? Or is BOOST_STATIC_ASSERT broken
for Intel's compiler?

I'm using a clean install of Boost 1.28.0 with
installed over it.

Kind Regards,

Dirk Gerrits

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