From 1617a513d29b579d1cbda2af29b395ed31ee07e5 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Tue, 29 Jul 2014 18:18:02 -0700 Subject: [PATCH 01/11] accomodate new boost::iterators namespace. See boostorg/iterator@dc96d371faf87a88c04057861136c9dfa68103d7 --- include/boost/range/detail/any_iterator.hpp | 3 +++ include/boost/range/detail/demote_iterator_traversal_tag.hpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/boost/range/detail/any_iterator.hpp b/include/boost/range/detail/any_iterator.hpp index 555bd57..bba3303 100644 --- a/include/boost/range/detail/any_iterator.hpp +++ b/include/boost/range/detail/any_iterator.hpp @@ -114,6 +114,8 @@ namespace boost }; } // namespace range_detail + namespace iterators + { namespace detail { // Rationale: @@ -246,6 +248,7 @@ namespace boost }; + } } namespace range_detail diff --git a/include/boost/range/detail/demote_iterator_traversal_tag.hpp b/include/boost/range/detail/demote_iterator_traversal_tag.hpp index 2127de9..f20a46b 100644 --- a/include/boost/range/detail/demote_iterator_traversal_tag.hpp +++ b/include/boost/range/detail/demote_iterator_traversal_tag.hpp @@ -79,8 +79,8 @@ BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal template struct demote_iterator_traversal_tag : inner_demote_iterator_traversal_tag< - typename boost::detail::pure_traversal_tag< IteratorTraversalTag1 >::type, - typename boost::detail::pure_traversal_tag< IteratorTraversalTag2 >::type + typename boost::iterators::detail::pure_traversal_tag< IteratorTraversalTag1 >::type, + typename boost::iterators::detail::pure_traversal_tag< IteratorTraversalTag2 >::type > { }; From 7fb879a283de9acc0d136be2d91cebf6b8e2b5db Mon Sep 17 00:00:00 2001 From: Neil Groves Date: Mon, 4 Aug 2014 17:53:14 +0100 Subject: [PATCH 02/11] Hotfix to add back advance_begin and advance_end. --- doc/reference/utilities.qbk | 7 +++++++ include/boost/range/iterator_range_core.hpp | 20 ++++++++++++++++++++ include/boost/range/sub_range.hpp | 14 ++++++++++++++ test/iterator_range.cpp | 18 ++++++++++++++++++ test/sub_range.cpp | 18 ++++++++++++++++++ 5 files changed, 77 insertions(+) diff --git a/doc/reference/utilities.qbk b/doc/reference/utilities.qbk index 24d11d7..8cbc34a 100644 --- a/doc/reference/utilities.qbk +++ b/doc/reference/utilities.qbk @@ -73,6 +73,10 @@ namespace boost void drop_front(); void drop_front(difference_type n); bool empty() const; + + iterator_range& advance_begin(difference_type n); + iterator_range& advance_end(difference_type n); + // for Bidirectional: value_type& back() const; void drop_back(); @@ -263,6 +267,9 @@ namespace boost reference front(); const_reference front() const; + sub_range& advance_begin(difference_type n); + sub_range& advance_end(difference_type n); + // If traversal >= bidirectional: reference back(); const_reference back(); diff --git a/include/boost/range/iterator_range_core.hpp b/include/boost/range/iterator_range_core.hpp index 143796b..8108947 100644 --- a/include/boost/range/iterator_range_core.hpp +++ b/include/boost/range/iterator_range_core.hpp @@ -266,6 +266,9 @@ public: BOOST_ASSERT(n >= difference_type()); std::advance(this->m_Begin, n); } + + // Deprecated + void pop_front() { drop_front(); } protected: template @@ -331,6 +334,9 @@ public: BOOST_ASSERT(n >= difference_type()); std::advance(this->m_End, -n); } + + // Deprecated + void pop_back() { drop_back(); } }; template @@ -528,6 +534,20 @@ public: return *this; } + iterator_range& advance_begin( + BOOST_DEDUCED_TYPENAME base_type::difference_type n) + { + std::advance(this->m_Begin, n); + return *this; + } + + iterator_range& advance_end( + BOOST_DEDUCED_TYPENAME base_type::difference_type n) + { + std::advance(this->m_End, n); + return *this; + } + protected: // // Allow subclasses an easy way to access the diff --git a/include/boost/range/sub_range.hpp b/include/boost/range/sub_range.hpp index ecc045b..8d5d168 100644 --- a/include/boost/range/sub_range.hpp +++ b/include/boost/range/sub_range.hpp @@ -261,6 +261,20 @@ public: iterator_range_::operator=( static_cast(r) ); return *this; } + + sub_range& advance_begin( + BOOST_DEDUCED_TYPENAME base::difference_type n) + { + std::advance(this->m_Begin, n); + return *this; + } + + sub_range& advance_end( + BOOST_DEDUCED_TYPENAME base::difference_type n) + { + std::advance(this->m_End, n); + return *this; + } }; } // namespace 'boost' diff --git a/test/iterator_range.cpp b/test/iterator_range.cpp index 6b4dda6..168eb22 100644 --- a/test/iterator_range.cpp +++ b/test/iterator_range.cpp @@ -249,6 +249,23 @@ inline void check_iterator_range_operator() Pred()); } +inline void test_advance() +{ + std::vector l; + l.push_back(1); + l.push_back(2); + typedef boost::iterator_range::iterator> rng_t; + + rng_t r1(l.begin(), l.end()); + BOOST_CHECK(r1.advance_begin(1).advance_end(-1).empty()); + + rng_t r2(l.begin(), l.end()); + BOOST_CHECK_EQUAL(r2.advance_begin(1).size(), 1u); + + rng_t r3(l.begin(), l.end()); + BOOST_CHECK_EQUAL(r3.advance_end(-1).size(), 1u); +} + boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] ) { boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" ); @@ -261,6 +278,7 @@ boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] ) test->add(BOOST_TEST_CASE(&check_iterator_range_operator)); test->add(BOOST_TEST_CASE(&check_iterator_range_operator)); test->add(BOOST_TEST_CASE(&iterator_range_test_detail::check_make_iterator_range_n)); + test->add(BOOST_TEST_CASE(&test_advance)); return test; } diff --git a/test/sub_range.cpp b/test/sub_range.cpp index 0ea8fed..be48811 100644 --- a/test/sub_range.cpp +++ b/test/sub_range.cpp @@ -228,6 +228,22 @@ void const_propagation_const_collection(void) check_constant_type(crng.back()); } +inline void test_advance() +{ + std::vector l; + l.push_back(1); + l.push_back(2); + typedef boost::sub_range > rng_t; + rng_t r1(l.begin(), l.end()); + BOOST_CHECK(r1.advance_begin(1).advance_end(-1).empty()); + + rng_t r2(l.begin(), l.end()); + BOOST_CHECK_EQUAL(r2.advance_begin(1).size(), 1u); + + rng_t r3(l.begin(), l.end()); + BOOST_CHECK_EQUAL(r3.advance_end(-1).size(), 1u); +} + } // anonymous namespace } // namespace boost_range_test @@ -244,6 +260,8 @@ boost::unit_test::test_suite* init_unit_test_suite(int, char*[]) test->add(BOOST_TEST_CASE( &boost_range_test::const_propagation_mutable_collection)); + test->add(BOOST_TEST_CASE(&boost_range_test::test_advance)); + return test; } From dc0a6b6340bbb471c672d3c6247273442fe85a5c Mon Sep 17 00:00:00 2001 From: Neil Groves Date: Mon, 4 Aug 2014 19:32:37 +0100 Subject: [PATCH 03/11] Add upgrade documentation about pop_front() and pop_back() being renamed. --- doc/upgrade.qbk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/upgrade.qbk b/doc/upgrade.qbk index 9bbf904..47fa8cb 100644 --- a/doc/upgrade.qbk +++ b/doc/upgrade.qbk @@ -15,6 +15,9 @@ been noted that some calling code was relying on member functions such as `size()` being present despite the underlying iterators not being random-access due to `iterator_reference::type` not being a reference. The suggested refactoring is to use `boost::size(rng)`. +# The undocumented __iterator_range__ `pop_front()` has been deprecated and is +replaced by `drop_front(). Similarly `pop_back()` has been replaced by +`drop_back()`. [endsect] From 7d13f63d5d1324abf519b67f59e1814b2cbe5d55 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Sat, 9 Aug 2014 14:48:57 -0700 Subject: [PATCH 04/11] avoid SFINAE problem in iterator_range constructor --- include/boost/range/iterator_range_core.hpp | 18 ++++++++++++++++-- test/iterator_range.cpp | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/boost/range/iterator_range_core.hpp b/include/boost/range/iterator_range_core.hpp index 8108947..2fbeb68 100644 --- a/include/boost/range/iterator_range_core.hpp +++ b/include/boost/range/iterator_range_core.hpp @@ -442,8 +442,8 @@ public: > base_type; template - struct is_compatible_range - : is_convertible< + struct is_compatible_range_ + : is_convertible< BOOST_DEDUCED_TYPENAME mpl::eval_if< has_range_iterator, range_iterator, @@ -454,6 +454,20 @@ public: { }; + template + struct is_compatible_range + : mpl::and_< + mpl::not_< + is_convertible< + Source, + BOOST_DEDUCED_TYPENAME base_type::iterator + > + >, + is_compatible_range_ + > + { + }; + protected: typedef iterator_range_detail::iterator_range_impl impl; diff --git a/test/iterator_range.cpp b/test/iterator_range.cpp index 168eb22..7fa8c74 100644 --- a/test/iterator_range.cpp +++ b/test/iterator_range.cpp @@ -266,6 +266,20 @@ inline void test_advance() BOOST_CHECK_EQUAL(r3.advance_end(-1).size(), 1u); } +struct ptr_iterator + : boost::iterator_adaptor +{ + ptr_iterator() = default; + ptr_iterator(int *p) : boost::iterator_adaptor(p) {} +private: + typedef void iterator; // To throw off the SFINAE mechanism in iterator_range +}; + +void test_sfinae() +{ + boost::iterator_range r(ptr_iterator(0), ptr_iterator(0)); +} + boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] ) { boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" ); From 470a28ecb66641c1a606926b3466f2d6fc19d240 Mon Sep 17 00:00:00 2001 From: Neil Groves Date: Fri, 15 Aug 2014 12:26:30 +0100 Subject: [PATCH 05/11] replace =default in test to fix iterator_range.cpp unit test regression with older compilers. --- test/iterator_range.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/iterator_range.cpp b/test/iterator_range.cpp index 7fa8c74..67c3f7e 100644 --- a/test/iterator_range.cpp +++ b/test/iterator_range.cpp @@ -269,7 +269,7 @@ inline void test_advance() struct ptr_iterator : boost::iterator_adaptor { - ptr_iterator() = default; + ptr_iterator() {} ptr_iterator(int *p) : boost::iterator_adaptor(p) {} private: typedef void iterator; // To throw off the SFINAE mechanism in iterator_range From a58e59ec67c6c38a67bcad1c910fe67a5289ac5f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 18 Aug 2014 15:09:55 +0100 Subject: [PATCH 06/11] Add metadata file. --- meta/libraries.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 meta/libraries.json diff --git a/meta/libraries.json b/meta/libraries.json new file mode 100644 index 0000000..9e2be20 --- /dev/null +++ b/meta/libraries.json @@ -0,0 +1,16 @@ +{ + "key": "range", + "name": "Range", + "authors": [ + "Niel Groves", + "Thorsten Ottosen" + ], + "description": "A new infrastructure for generic algorithms that builds on top of the new iterator concepts.", + "category": [ + "Algorithms" + ], + "maintainers": [ + "Neil Groves ", + "Nathan Ridge " + ] +} From 4617c43b5e8c95896dde8d3e1d0eca9659c61ad6 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 30 Aug 2014 16:04:46 +0400 Subject: [PATCH 07/11] Use public interface of Boost.Iterator --- include/boost/range/detail/demote_iterator_traversal_tag.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/range/detail/demote_iterator_traversal_tag.hpp b/include/boost/range/detail/demote_iterator_traversal_tag.hpp index f20a46b..6d65720 100644 --- a/include/boost/range/detail/demote_iterator_traversal_tag.hpp +++ b/include/boost/range/detail/demote_iterator_traversal_tag.hpp @@ -79,8 +79,8 @@ BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal template struct demote_iterator_traversal_tag : inner_demote_iterator_traversal_tag< - typename boost::iterators::detail::pure_traversal_tag< IteratorTraversalTag1 >::type, - typename boost::iterators::detail::pure_traversal_tag< IteratorTraversalTag2 >::type + typename boost::iterators::pure_traversal_tag< IteratorTraversalTag1 >::type, + typename boost::iterators::pure_traversal_tag< IteratorTraversalTag2 >::type > { }; From 51b8115fc103774169419b2a8350bbfc03f40958 Mon Sep 17 00:00:00 2001 From: insideoutclub Date: Fri, 5 Sep 2014 10:34:21 -0700 Subject: [PATCH 08/11] Update algorithms.qbk Fixed the spelling of "old-fashioned". --- doc/reference/algorithms.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/algorithms.qbk b/doc/reference/algorithms.qbk index ce4b140..8dcd848 100644 --- a/doc/reference/algorithms.qbk +++ b/doc/reference/algorithms.qbk @@ -63,7 +63,7 @@ std::vector vec = ...; boost::erase(vec, boost::unique(boost::sort(vec))); `` -Notice the use of `boost::return_found_end`. What if we wanted to erase all the duplicates except one of them? In old-fashined STL-programming we might write +Notice the use of `boost::return_found_end`. What if we wanted to erase all the duplicates except one of them? In old-fashioned STL-programming we might write `` // assume 'vec' is already sorted From 0e9a9e613bcd16ec6e28faf86407f2cab3f0d4fa Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Sep 2014 15:37:45 +0200 Subject: [PATCH 09/11] Rely on the 'typename' keyword from the compiler. Remove trailing whitespace from modified lines. git grep -l BOOST_STRING_TYPENAME | xargs sed -i 's|BOOST_STRING_TYPENAME *$|typename|' git grep -l BOOST_STRING_TYPENAME | xargs sed -i 's|BOOST_STRING_TYPENAME \(.*\) +$|typename \1|' git grep -l BOOST_STRING_TYPENAME | xargs sed -i 's|BOOST_STRING_TYPENAME|typename|' Remove include of header from Boost.Algorithm library providing the define. --- .../boost/range/detail/collection_traits.hpp | 43 +++++++++-------- .../range/detail/collection_traits_detail.hpp | 47 +++++++++---------- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/include/boost/range/detail/collection_traits.hpp b/include/boost/range/detail/collection_traits.hpp index c50ca3e..823c0af 100644 --- a/include/boost/range/detail/collection_traits.hpp +++ b/include/boost/range/detail/collection_traits.hpp @@ -22,7 +22,6 @@ #ifndef BOOST_RANGE_STRING_COLLECTION_TRAITS_HPP #define BOOST_RANGE_STRING_COLLECTION_TRAITS_HPP -#include #include #include #include @@ -74,13 +73,13 @@ namespace boost { struct collection_traits { private: - typedef BOOST_STRING_TYPENAME ::boost::mpl::eval_if< + typedef typename ::boost::mpl::eval_if< ::boost::algorithm::detail::is_pair, detail::pair_container_traits_selector, - BOOST_STRING_TYPENAME ::boost::mpl::eval_if< + typename ::boost::mpl::eval_if< ::boost::is_array, detail::array_container_traits_selector, - BOOST_STRING_TYPENAME ::boost::mpl::eval_if< + typename ::boost::mpl::eval_if< ::boost::is_pointer, detail::pointer_container_traits_selector, detail::default_container_traits_selector @@ -91,22 +90,22 @@ namespace boost { //! Function type typedef container_helper_type function_type; //! Value type - typedef BOOST_STRING_TYPENAME + typedef typename container_helper_type::value_type value_type; //! Size type - typedef BOOST_STRING_TYPENAME + typedef typename container_helper_type::size_type size_type; //! Iterator type - typedef BOOST_STRING_TYPENAME + typedef typename container_helper_type::iterator iterator; //! Const iterator type - typedef BOOST_STRING_TYPENAME + typedef typename container_helper_type::const_iterator const_iterator; //! Result iterator type ( iterator of const_iterator, depending on the constness of the container ) - typedef BOOST_STRING_TYPENAME + typedef typename container_helper_type::result_iterator result_iterator; //! Difference type - typedef BOOST_STRING_TYPENAME + typedef typename container_helper_type::difference_type difference_type; }; // 'collection_traits' @@ -120,7 +119,7 @@ namespace boost { template< typename C > struct value_type_of { - typedef BOOST_STRING_TYPENAME collection_traits::value_type type; + typedef typename collection_traits::value_type type; }; //! Container difference trait @@ -130,7 +129,7 @@ namespace boost { template< typename C > struct difference_type_of { - typedef BOOST_STRING_TYPENAME collection_traits::difference_type type; + typedef typename collection_traits::difference_type type; }; //! Container iterator trait @@ -140,7 +139,7 @@ namespace boost { template< typename C > struct iterator_of { - typedef BOOST_STRING_TYPENAME collection_traits::iterator type; + typedef typename collection_traits::iterator type; }; //! Container const_iterator trait @@ -150,7 +149,7 @@ namespace boost { template< typename C > struct const_iterator_of { - typedef BOOST_STRING_TYPENAME collection_traits::const_iterator type; + typedef typename collection_traits::const_iterator type; }; @@ -162,7 +161,7 @@ namespace boost { template< typename C > struct result_iterator_of { - typedef BOOST_STRING_TYPENAME collection_traits::result_iterator type; + typedef typename collection_traits::result_iterator type; }; // collection_traits related functions -----------------------------------------// @@ -172,7 +171,7 @@ namespace boost { Get the size of the container. Uses collection_traits. */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::size_type + inline typename collection_traits::size_type size( const C& c ) { return collection_traits::function_type::size( c ); @@ -195,7 +194,7 @@ namespace boost { Get the begin iterator of the container. Uses collection_traits. */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::iterator + inline typename collection_traits::iterator begin( C& c ) { return collection_traits::function_type::begin( c ); @@ -206,7 +205,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::const_iterator + inline typename collection_traits::const_iterator begin( const C& c ) { return collection_traits::function_type::begin( c ); @@ -217,7 +216,7 @@ namespace boost { Get the begin iterator of the container. Uses collection_traits. */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::iterator + inline typename collection_traits::iterator end( C& c ) { return collection_traits::function_type::end( c ); @@ -228,7 +227,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::const_iterator + inline typename collection_traits::const_iterator end( const C& c ) { return collection_traits::function_type::end( c ); @@ -241,7 +240,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::result_iterator + inline typename collection_traits::result_iterator begin( C& c ) { return collection_traits::function_type::begin( c ); @@ -252,7 +251,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits::result_iterator + inline typename collection_traits::result_iterator end( C& c ) { return collection_traits::function_type::end( c ); diff --git a/include/boost/range/detail/collection_traits_detail.hpp b/include/boost/range/detail/collection_traits_detail.hpp index 1f2b77c..c9c3fb3 100644 --- a/include/boost/range/detail/collection_traits_detail.hpp +++ b/include/boost/range/detail/collection_traits_detail.hpp @@ -10,7 +10,6 @@ #ifndef BOOST_RANGE_STRING_DETAIL_COLLECTION_TRAITS_HPP #define BOOST_RANGE_STRING_DETAIL_COLLECTION_TRAITS_HPP -#include #include #include #include @@ -41,16 +40,16 @@ namespace boost { template< typename ContainerT > struct default_container_traits { - typedef BOOST_STRING_TYPENAME ContainerT::value_type value_type; - typedef BOOST_STRING_TYPENAME ContainerT::iterator iterator; - typedef BOOST_STRING_TYPENAME ContainerT::const_iterator const_iterator; - typedef BOOST_STRING_TYPENAME + typedef typename ContainerT::value_type value_type; + typedef typename ContainerT::iterator iterator; + typedef typename ContainerT::const_iterator const_iterator; + typedef typename ::boost::mpl::if_< ::boost::is_const, const_iterator, iterator >::type result_iterator; - typedef BOOST_STRING_TYPENAME ContainerT::difference_type difference_type; - typedef BOOST_STRING_TYPENAME ContainerT::size_type size_type; + typedef typename ContainerT::difference_type difference_type; + typedef typename ContainerT::size_type size_type; // static operations template< typename C > @@ -135,12 +134,12 @@ namespace boost { template< typename PairT > struct pair_container_traits { - typedef BOOST_STRING_TYPENAME PairT::first_type element_type; + typedef typename PairT::first_type element_type; - typedef BOOST_STRING_TYPENAME ::boost::detail:: + typedef typename ::boost::detail:: iterator_traits::value_type value_type; typedef std::size_t size_type; - typedef BOOST_STRING_TYPENAME ::boost::detail:: + typedef typename ::boost::detail:: iterator_traits::difference_type difference_type; typedef element_type iterator; @@ -221,7 +220,7 @@ namespace boost { template< typename TraitsT > struct array_length { - typedef BOOST_STRING_TYPENAME + typedef typename TraitsT::size_type size_type; BOOST_STATIC_CONSTANT( @@ -249,7 +248,7 @@ namespace boost { template< typename TraitsT > struct array_length { - typedef BOOST_STRING_TYPENAME + typedef typename TraitsT::size_type size_type; template< typename A > @@ -276,7 +275,7 @@ namespace boost { template< typename TraitsT > struct array_length { - typedef BOOST_STRING_TYPENAME + typedef typename TraitsT::size_type size_type; template< typename A > @@ -304,18 +303,18 @@ namespace boost { typedef array_traits traits_type; public: - typedef BOOST_STRING_TYPENAME + typedef typename traits_type::value_type value_type; - typedef BOOST_STRING_TYPENAME + typedef typename traits_type::iterator iterator; - typedef BOOST_STRING_TYPENAME + typedef typename traits_type::const_iterator const_iterator; - typedef BOOST_STRING_TYPENAME + typedef typename traits_type::size_type size_type; - typedef BOOST_STRING_TYPENAME + typedef typename traits_type::difference_type difference_type; - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::mpl::if_< ::boost::is_const, const_iterator, iterator @@ -323,9 +322,9 @@ namespace boost { private: // resolve array size - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::remove_cv::type char_type; - typedef BOOST_STRING_TYPENAME + typedef typename array_length_selector:: BOOST_NESTED_TEMPLATE array_length array_length_type; @@ -401,10 +400,10 @@ namespace boost { template struct pointer_container_traits { - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::remove_pointer::type value_type; - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::remove_cv::type char_type; typedef ::std::char_traits char_traits; @@ -413,7 +412,7 @@ namespace boost { typedef std::ptrdiff_t difference_type; typedef std::size_t size_type; - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::mpl::if_< ::boost::is_const, const_iterator, iterator From 8bb3a85f68797710a591c4b29646f2ce89015fe6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Sep 2014 15:37:21 +0200 Subject: [PATCH 10/11] Use local sfinae typedefs for yes_type and no_type. Remove dependency on Boost.Algorithm library. --- include/boost/range/detail/collection_traits_detail.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/range/detail/collection_traits_detail.hpp b/include/boost/range/detail/collection_traits_detail.hpp index c9c3fb3..1545997 100644 --- a/include/boost/range/detail/collection_traits_detail.hpp +++ b/include/boost/range/detail/collection_traits_detail.hpp @@ -23,7 +23,6 @@ #include #include #include -#include // Container traits implementation --------------------------------------------------------- @@ -115,7 +114,10 @@ namespace boost { }; // Pair container traits --------------------------------------------------------------------- - + + typedef double yes_type; + typedef char no_type; + // pair selector template< typename T, typename U > yes_type is_pair_impl( const std::pair* ); From 688d1bc41850fd20d85833dd86b907be7dbc7f14 Mon Sep 17 00:00:00 2001 From: Neil Groves Date: Sat, 31 Jan 2015 13:31:33 +0000 Subject: [PATCH 11/11] Update inclusion of polymorphic_cast.hpp to cat.hpp --- include/boost/range/detail/any_iterator_wrapper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/range/detail/any_iterator_wrapper.hpp b/include/boost/range/detail/any_iterator_wrapper.hpp index bcd9b7f..c542d39 100644 --- a/include/boost/range/detail/any_iterator_wrapper.hpp +++ b/include/boost/range/detail/any_iterator_wrapper.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_RANGE_DETAIL_ANY_ITERATOR_WRAPPER_HPP_INCLUDED #define BOOST_RANGE_DETAIL_ANY_ITERATOR_WRAPPER_HPP_INCLUDED -#include +#include #include #include #include