|
Boost : |
From: Dirk Gerrits (dirk_at_[hidden])
Date: 2002-09-15 10:27:20
Hi,
I believe the example at
http://www.mywikinet.com/mpl/ref/Reference/find.html
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
http://www.mywikinet.com/mpl/mpl_23_jul_02_full.zip
installed over it.
Kind Regards,
Dirk Gerrits
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk