Problem with boost::iterator_value

Hi, The following code does not compile under vc7.0-stlport-4.6.2: struct foo {}; typedef std::vector<int> vector_int; typedef std::vector<foo> vector_foo; BOOST_STATIC_ASSERT(( boost::is_same< int, boost::iterator_value<vector_int::iterator>::type>:: value)); BOOST_STATIC_ASSERT(( boost::is_same< foo, boost::iterator_value<vector_foo::iterator>::type>:: value)); Obviously, neither of these assertions should fail, but the second one does. I'm guessing that this is a problem with boost::iterator_value. Does anyone know how to fix this? Thanks, Alex

"Alex Chovanec" <achovane@engin.umich.edu> wrote in message news:cfukc4$6l4$1@sea.gmane.org... | Hi, | | The following code does not compile under vc7.0-stlport-4.6.2: | | struct foo {}; | | typedef std::vector<int> vector_int; | typedef std::vector<foo> vector_foo; | | BOOST_STATIC_ASSERT(( | boost::is_same< | int, | boost::iterator_value<vector_int::iterator>::type>:: | value)); | | BOOST_STATIC_ASSERT(( | boost::is_same< | foo, | boost::iterator_value<vector_foo::iterator>::type>:: | value)); | | Obviously, neither of these assertions should fail, but the second one does. | I'm guessing that this is a problem with boost::iterator_value. well, the problem is with vc7. |Does anyone | know how to fix this? look at the documentation at http://www.boost.org/libs/iterator/doc/iterator_traits.html and apply BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION( foo ); br Thorsten

"Thorsten Ottosen" <nesotto@cs.auc.dk> writes: D> | Obviously, neither of these assertions should fail, but the second one does.
| I'm guessing that this is a problem with boost::iterator_value.
well, the problem is with vc7.
|Does anyone | know how to fix this?
look at the documentation at http://www.boost.org/libs/iterator/doc/iterator_traits.html and apply
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION( foo );
Right. The assertion is not in fact failing until after another error occurs, and you should see some mention of BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION in that error message. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (3)
-
Alex Chovanec
-
David Abrahams
-
Thorsten Ottosen