Boost logo

Boost :

From: Slavomir Kaslev (slavomir.kaslev_at_[hidden])
Date: 2008-04-29 10:33:50


Can someone explain why this simple snippet fails to compile? Am I
doing something wrong or is this iterator_range problem?

I've tested it on msvc 2005 and g++ 4.2.3 against boost trunk.

#include <boost/static_assert.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/iterator_range.hpp>

int main()
{
    using namespace boost::mpl;
    using namespace boost::mpl::placeholders;

    typedef vector_c<int, 1, 2, 3, 4> test_t;
    typedef begin<test_t>::type first;
    typedef advance<first, int_<2> >::type last;
    typedef iterator_range<first, last>::type range;

    BOOST_STATIC_ASSERT(( equal<range, vector_c<int, 1, 2> >::value ));

    typedef transform<range, identity<_> >::type transformed_range;
}

Thank you in advance.

-- 
Slavomir Kaslev

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk