On Wed, Nov 28, 2012 at 9:41 AM, Robert Jones
Here's the compiler output....
|| ~/local/gcc-4.6.2/bin/g++ -std=c++0x -I ~/local/boost_1_48_0/include -g -W -fno-strict-aliasing -fno-inline -Wno-uninitialized -Wcast-align -Wwrite-strings -Wnon-virtual-dtor -Wextra -c -o range_for.o range_for.cpp In file included from /home/rjones/local/boost_1_48_0/include/boost/iterator/iterator_categories.hpp|15| 0, || from /home/rjones/local/boost_1_48_0/include/boost/iterator/detail/facade_iterator_category.hpp:7, || from /home/rjones/local/boost_1_48_0/include/boost/iterator/iterator_facade.hpp:14, || from /home/rjones/local/boost_1_48_0/include/boost/range/iterator_range_core.hpp:23, || from /home/rjones/local/boost_1_48_0/include/boost/range/counting_range.hpp:18, || from range_for.cpp:1: || /home/rjones/local/boost_1_48_0/include/boost/mpl/eval_if.hpp: In instantiation of ‘boost::mpl::eval_if_c
’: /home/rjones/local/boost_1_48_0/include/boost/range/iterator.hpp|63 col 63| instantiated from ‘boost::range_iterator<int>’ /home/rjones/local/boost_1_48_0/include/boost/range/value_type.hpp|30 col 12| instantiated from ‘boost::range_value<int>’ range_for.cpp|9 col 47| instantiated from here /home/rjones/local/boost_1_48_0/include/boost/mpl/eval_if.hpp|60 col 31| error: no type named ‘type’ in ‘boost::mpl::eval_if_c ::f_ {aka struct boost::range_mutable_iterator<int>}’ || /home/rjones/local/boost_1_48_0/include/boost/mpl/eval_if.hpp: In instantiation of ‘boost::mpl::eval_if_c ’: /home/rjones/local/boost_1_48_0/include/boost/range/iterator.hpp|63 col 63| instantiated from ‘boost::range_iterator<const int>’ /home/rjones/local/boost_1_48_0/include/boost/range/value_type.hpp|30 col 12| instantiated from ‘boost::range_value<const int>’ range_for.cpp|9 col 47| instantiated from here /home/rjones/local/boost_1_48_0/include/boost/mpl/eval_if.hpp|60 col 31| error: no type named ‘type’ in ‘boost::mpl::eval_if_c
Looks like gcc is instantiating the unary overloads of counting_range (with template parameter int) even though you're supplying 2 arguments...I'm not sure if that is standard behavior or not; MSVC9 seems to do okay with it. Is this is a real hindrance or merely curiosity? - Jeff