diff --git a/include/boost/range/begin.hpp b/include/boost/range/begin.hpp index 57ee344..d16ce1e 100755 --- a/include/boost/range/begin.hpp +++ b/include/boost/range/begin.hpp @@ -190,7 +190,7 @@ namespace boost inline BOOST_DEDUCED_TYPENAME range_const_iterator::type const_begin( const T& r ) { - return begin( r ); + return boost::begin( r ); } } diff --git a/include/boost/range/detail/common.hpp b/include/boost/range/detail/common.hpp index 38ef7c8..36fada1 100755 --- a/include/boost/range/detail/common.hpp +++ b/include/boost/range/detail/common.hpp @@ -78,35 +78,35 @@ namespace boost template< typename C > class range { - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_pair_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_pair_, boost::range_detail::std_pair_, void >::type pair_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_array_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_array_, boost::range_detail::array_, pair_t >::type array_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_string_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_string_, boost::range_detail::string_, array_t >::type string_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_const_char_ptr_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_const_char_ptr_, boost::range_detail::const_char_ptr_, string_t >::type const_char_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_char_ptr_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_char_ptr_, boost::range_detail::char_ptr_, const_char_ptr_t >::type char_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_const_wchar_t_ptr_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_const_wchar_t_ptr_, boost::range_detail::const_wchar_t_ptr_, char_ptr_t >::type const_wchar_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_wchar_t_ptr_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_wchar_t_ptr_, boost::range_detail::wchar_t_ptr_, const_wchar_ptr_t >::type wchar_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_wchar_t_array_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_wchar_t_array_, boost::range_detail::wchar_t_array_, wchar_ptr_t >::type wchar_array_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::range_detail::range_helper::is_char_array_, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_char_array_, boost::range_detail::char_array_, wchar_array_t >::type char_array_t; public: - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< boost::is_void::value, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::is_void::value, boost::range_detail::std_container_, char_array_t >::type type; }; // class 'range' diff --git a/include/boost/range/end.hpp b/include/boost/range/end.hpp index f7eb2f8..493208f 100755 --- a/include/boost/range/end.hpp +++ b/include/boost/range/end.hpp @@ -194,7 +194,7 @@ namespace boost inline BOOST_DEDUCED_TYPENAME range_const_iterator::type const_end( const T& r ) { - return end( r ); + return boost::end( r ); } } diff --git a/include/boost/range/iterator_range.hpp b/include/boost/range/iterator_range.hpp index 9b30b7b..b29df15 100755 --- a/include/boost/range/iterator_range.hpp +++ b/include/boost/range/iterator_range.hpp @@ -57,15 +57,13 @@ namespace boost template< class ForwardRange > static IteratorT adl_begin( ForwardRange& r ) { - using boost::begin; - return IteratorT( begin( r ) ); + return IteratorT( boost::begin( r ) ); } template< class ForwardRange > static IteratorT adl_end( ForwardRange& r ) { - using boost::end; - return IteratorT( end( r ) ); + return IteratorT( boost::end( r ) ); } }; @@ -74,23 +72,23 @@ namespace boost { typedef BOOST_DEDUCED_TYPENAME boost::range_size::type sz_type; - sz_type l_size = size( l ), - r_size = size( r ); + sz_type l_size = boost::size( l ), + r_size = boost::size( r ); if( l_size != r_size ) return false; - return std::equal( begin(l), end(l), - begin(r) ); + return std::equal( boost::begin(l), boost::end(l), + boost::begin(r) ); } template< class Left, class Right > inline bool less_than( const Left& l, const Right& r ) { - return std::lexicographical_compare( begin(l), - end(l), - begin(r), - end(r) ); + return std::lexicographical_compare( boost::begin(l), + boost::end(l), + boost::begin(r), + boost::end(r) ); } struct range_tag { }; @@ -143,13 +141,13 @@ namespace boost //! This type typedef iterator_range this_type; - //! Refence type - // - // Needed because value-type is the same for - // const and non-const iterators - // - typedef BOOST_DEDUCED_TYPENAME - iterator_reference::type reference; + //! Refence type + // + // Needed because value-type is the same for + // const and non-const iterators + // + typedef BOOST_DEDUCED_TYPENAME + iterator_reference::type reference; //! const_iterator type /*! @@ -334,16 +332,18 @@ namespace boost return m_Begin[sz]; } - void advance_begin( difference_type n ) - { - std::advance( m_Begin, n ); - } - - void advance_end( difference_type n ) - { - std::advance( m_End, n ); - } - + iterator_range& advance_begin( difference_type n ) + { + std::advance( m_Begin, n ); + return *this; + } + + iterator_range& advance_end( difference_type n ) + { + std::advance( m_End, n ); + return *this; + } + private: // begin and end iterators IteratorT m_Begin; @@ -378,7 +378,10 @@ namespace boost std::basic_ostream& Os, const iterator_range& r ) { - std::copy( r.begin(), r.end(), std::ostream_iterator(Os)); + std::copy( r.begin(), r.end(), + std::ostream_iterator< BOOST_DEDUCED_TYPENAME + iterator_value::type, + Elem, Traits>(Os) ); return Os; } @@ -497,7 +500,7 @@ namespace boost make_iterator_range( Range& r ) { return iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator::type > - ( begin( r ), end( r ) ); + ( boost::begin( r ), boost::end( r ) ); } #else @@ -536,8 +539,8 @@ namespace boost return make_iterator_range( r ); BOOST_DEDUCED_TYPENAME range_result_iterator::type - new_begin = begin( r ), - new_end = end( r ); + new_begin = boost::begin( r ), + new_end = boost::end( r ); std::advance( new_begin, advance_begin ); std::advance( new_end, advance_end ); return make_iterator_range( new_begin, new_end ); @@ -591,7 +594,7 @@ namespace boost template< typename SeqT, typename Range > inline SeqT copy_range( const Range& r ) { - return SeqT( begin( r ), end( r ) ); + return SeqT( boost::begin( r ), boost::end( r ) ); } } // namespace 'boost' diff --git a/include/boost/range/rbegin.hpp b/include/boost/range/rbegin.hpp index f87717a..0fcf00c 100755 --- a/include/boost/range/rbegin.hpp +++ b/include/boost/range/rbegin.hpp @@ -42,7 +42,7 @@ rbegin( C& c ) typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator< typename remove_const::type >::type iter_type; - return iter_type( end( c ) ); + return iter_type( boost::end( c ) ); } template< class C > @@ -51,7 +51,7 @@ rbegin( const C& c ) { typedef BOOST_DEDUCED_TYPENAME range_const_reverse_iterator::type iter_type; - return iter_type( end( c ) ); + return iter_type( boost::end( c ) ); } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING @@ -60,7 +60,7 @@ template< class T > inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator::type const_rbegin( const T& r ) { - return rbegin( r ); + return boost::rbegin( r ); } } // namespace 'boost' diff --git a/include/boost/range/rend.hpp b/include/boost/range/rend.hpp index e654c60..3e91ff7 100755 --- a/include/boost/range/rend.hpp +++ b/include/boost/range/rend.hpp @@ -29,7 +29,7 @@ template< class C > inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator::type rend( C& c ) { - return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator::type( begin( c ) ); + return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator::type( boost::begin( c ) ); } #else @@ -42,7 +42,7 @@ rend( C& c ) typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator< typename remove_const::type >::type iter_type; - return iter_type( begin( c ) ); + return iter_type( boost::begin( c ) ); } template< class C > @@ -51,7 +51,7 @@ rend( const C& c ) { typedef BOOST_DEDUCED_TYPENAME range_const_reverse_iterator::type iter_type; - return iter_type( begin( c ) ); + return iter_type( boost::begin( c ) ); } #endif @@ -60,7 +60,7 @@ template< class T > inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator::type const_rend( const T& r ) { - return rend( r ); + return boost::rend( r ); } } // namespace 'boost' diff --git a/include/boost/range/sub_range.hpp b/include/boost/range/sub_range.hpp index 1dc7d10..7781fca 100755 --- a/include/boost/range/sub_range.hpp +++ b/include/boost/range/sub_range.hpp @@ -35,14 +35,16 @@ namespace boost typedef BOOST_DEDUCED_TYPENAME range_const_iterator::type const_iterator; typedef BOOST_DEDUCED_TYPENAME range_difference::type difference_type; typedef BOOST_DEDUCED_TYPENAME range_size::type size_type; + typedef BOOST_DEDUCED_TYPENAME base::reference reference; + typedef BOOST_DEDUCED_TYPENAME iterator_reference::type const_reference; public: sub_range() : base() { } -/* - template< class ForwardRange2 > - sub_range( sub_range r ) : +/* + template< class ForwardRange2 > + sub_range( sub_range r ) : #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 800 ) base( impl::adl_begin( r ), impl::adl_end( r ) ) @@ -50,7 +52,7 @@ namespace boost base( r ) #endif */ - template< class ForwardRange2 > + template< class ForwardRange2 > sub_range( ForwardRange2& r ) : #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 800 ) @@ -89,15 +91,15 @@ namespace boost return *this; } - sub_range& operator=( sub_range r ) - { - // - // argument passed by value to avoid - // const_iterator to iterator conversion - // - base::operator=( r ); - return *this; - } + sub_range& operator=( sub_range r ) + { + // + // argument passed by value to avoid + // const_iterator to iterator conversion + // + base::operator=( r ); + return *this; + } public: @@ -109,32 +111,32 @@ namespace boost public: // convenience - value_type& front() + reference front() { return base::front(); } - const value_type& front() const + const_reference front() const { return base::front(); } - value_type& back() + reference back() { return base::back(); } - const value_type& back() const + const_reference back() const { return base::back(); } - value_type& operator[]( size_type sz ) + reference operator[]( size_type sz ) { return base::operator[](sz); } - const value_type& operator[]( size_type sz ) const + const_reference operator[]( size_type sz ) const { return base::operator[](sz); }