Ticket #8338: iterator-range-pointer-to-array.patch
File iterator-range-pointer-to-array.patch, 1.6 KB (added by , 10 years ago) |
---|
-
boost/range/iterator_range_core.hpp
21 21 #include <boost/assert.hpp> 22 22 #include <boost/iterator/iterator_traits.hpp> 23 23 #include <boost/iterator/iterator_facade.hpp> 24 #include <boost/mpl/or.hpp> 24 25 #include <boost/type_traits/is_abstract.hpp> 26 #include <boost/type_traits/is_array.hpp> 25 27 #include <boost/type_traits/is_pointer.hpp> 26 28 #include <boost/range/functions.hpp> 27 29 #include <boost/range/iterator.hpp> … … 167 169 168 170 private: // for return value of operator()() 169 171 typedef BOOST_DEDUCED_TYPENAME 170 boost::mpl::if_< boost::is_abstract<value_type>, 172 boost::mpl::if_< boost::mpl::or_< boost::is_abstract< value_type >, 173 boost::is_array< value_type > >, 171 174 reference, value_type >::type abstract_value_type; 172 175 173 176 public: -
libs/range/test/iterator_range.cpp
101 101 BOOST_CHECK( rrr == str ); 102 102 103 103 check_reference_type(); 104 105 // Check that an iterator range can be instantiated with 106 // a pointer to an array as an iterator. 107 int arr[2][2]; 108 boost::make_iterator_range(arr, arr + 2); 104 109 } 105 110 106 111 namespace iterator_range_test_detail