diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-03-21 15:45:20 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-03-21 15:46:37 +0900 |
commit | 733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /boost/range | |
parent | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff) | |
download | boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2 boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip |
Imported Upstream version 1.58.0upstream/1.58.0
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/range')
-rw-r--r-- | boost/range/detail/any_iterator.hpp | 6 | ||||
-rw-r--r-- | boost/range/detail/any_iterator_wrapper.hpp | 2 | ||||
-rw-r--r-- | boost/range/detail/collection_traits.hpp | 43 | ||||
-rw-r--r-- | boost/range/detail/collection_traits_detail.hpp | 53 | ||||
-rw-r--r-- | boost/range/detail/demote_iterator_traversal_tag.hpp | 4 | ||||
-rw-r--r-- | boost/range/iterator_range_core.hpp | 18 |
6 files changed, 71 insertions, 55 deletions
diff --git a/boost/range/detail/any_iterator.hpp b/boost/range/detail/any_iterator.hpp index 555bd574fb..044237c595 100644 --- a/boost/range/detail/any_iterator.hpp +++ b/boost/range/detail/any_iterator.hpp @@ -114,6 +114,8 @@ namespace boost }; } // namespace range_detail + namespace iterators + { namespace detail { // Rationale: @@ -245,8 +247,8 @@ namespace boost any_iterator_type stored_iterator; }; - - } + } //namespace detail + } //namespace iterators namespace range_detail { diff --git a/boost/range/detail/any_iterator_wrapper.hpp b/boost/range/detail/any_iterator_wrapper.hpp index bcd9b7f8ea..c542d39a2f 100644 --- a/boost/range/detail/any_iterator_wrapper.hpp +++ b/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 <boost/polymorphic_cast.hpp> +#include <boost/cast.hpp> #include <boost/range/config.hpp> #include <boost/range/detail/any_iterator_interface.hpp> #include <boost/range/concepts.hpp> diff --git a/boost/range/detail/collection_traits.hpp b/boost/range/detail/collection_traits.hpp index c50ca3e83d..823c0afc95 100644 --- a/boost/range/detail/collection_traits.hpp +++ b/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 <boost/algorithm/string/config.hpp> #include <boost/type_traits/is_array.hpp> #include <boost/type_traits/is_pointer.hpp> #include <boost/mpl/eval_if.hpp> @@ -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<T>, detail::pair_container_traits_selector<T>, - BOOST_STRING_TYPENAME ::boost::mpl::eval_if< + typename ::boost::mpl::eval_if< ::boost::is_array<T>, detail::array_container_traits_selector<T>, - BOOST_STRING_TYPENAME ::boost::mpl::eval_if< + typename ::boost::mpl::eval_if< ::boost::is_pointer<T>, detail::pointer_container_traits_selector<T>, detail::default_container_traits_selector<T> @@ -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<C>::value_type type; + typedef typename collection_traits<C>::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<C>::difference_type type; + typedef typename collection_traits<C>::difference_type type; }; //! Container iterator trait @@ -140,7 +139,7 @@ namespace boost { template< typename C > struct iterator_of { - typedef BOOST_STRING_TYPENAME collection_traits<C>::iterator type; + typedef typename collection_traits<C>::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<C>::const_iterator type; + typedef typename collection_traits<C>::const_iterator type; }; @@ -162,7 +161,7 @@ namespace boost { template< typename C > struct result_iterator_of { - typedef BOOST_STRING_TYPENAME collection_traits<C>::result_iterator type; + typedef typename collection_traits<C>::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<C>::size_type + inline typename collection_traits<C>::size_type size( const C& c ) { return collection_traits<C>::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<C>::iterator + inline typename collection_traits<C>::iterator begin( C& c ) { return collection_traits<C>::function_type::begin( c ); @@ -206,7 +205,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits<C>::const_iterator + inline typename collection_traits<C>::const_iterator begin( const C& c ) { return collection_traits<C>::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<C>::iterator + inline typename collection_traits<C>::iterator end( C& c ) { return collection_traits<C>::function_type::end( c ); @@ -228,7 +227,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits<C>::const_iterator + inline typename collection_traits<C>::const_iterator end( const C& c ) { return collection_traits<C>::function_type::end( c ); @@ -241,7 +240,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits<C>::result_iterator + inline typename collection_traits<C>::result_iterator begin( C& c ) { return collection_traits<C>::function_type::begin( c ); @@ -252,7 +251,7 @@ namespace boost { \overload */ template< typename C > - inline BOOST_STRING_TYPENAME collection_traits<C>::result_iterator + inline typename collection_traits<C>::result_iterator end( C& c ) { return collection_traits<C>::function_type::end( c ); diff --git a/boost/range/detail/collection_traits_detail.hpp b/boost/range/detail/collection_traits_detail.hpp index 1f2b77ccf9..15459974ef 100644 --- a/boost/range/detail/collection_traits_detail.hpp +++ b/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 <boost/algorithm/string/config.hpp> #include <cstddef> #include <string> #include <boost/type_traits/is_array.hpp> @@ -24,7 +23,6 @@ #include <boost/mpl/vector.hpp> #include <boost/mpl/fold.hpp> #include <boost/detail/iterator.hpp> -#include <boost/algorithm/string/yes_no_type.hpp> // Container traits implementation --------------------------------------------------------- @@ -41,16 +39,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<ContainerT>, 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 > @@ -116,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<T,U>* ); @@ -135,12 +136,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<element_type>::value_type value_type; typedef std::size_t size_type; - typedef BOOST_STRING_TYPENAME ::boost::detail:: + typedef typename ::boost::detail:: iterator_traits<element_type>::difference_type difference_type; typedef element_type iterator; @@ -221,7 +222,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 +250,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 +277,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 +305,18 @@ namespace boost { typedef array_traits<T> 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<T>, const_iterator, iterator @@ -323,9 +324,9 @@ namespace boost { private: // resolve array size - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::remove_cv<value_type>::type char_type; - typedef BOOST_STRING_TYPENAME + typedef typename array_length_selector<char_type>:: BOOST_NESTED_TEMPLATE array_length<traits_type> array_length_type; @@ -401,10 +402,10 @@ namespace boost { template<typename T> struct pointer_container_traits { - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::remove_pointer<T>::type value_type; - typedef BOOST_STRING_TYPENAME + typedef typename ::boost::remove_cv<value_type>::type char_type; typedef ::std::char_traits<char_type> char_traits; @@ -413,7 +414,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<T>, const_iterator, iterator diff --git a/boost/range/detail/demote_iterator_traversal_tag.hpp b/boost/range/detail/demote_iterator_traversal_tag.hpp index 2127de96fc..6d65720a05 100644 --- a/boost/range/detail/demote_iterator_traversal_tag.hpp +++ b/boost/range/detail/demote_iterator_traversal_tag.hpp @@ -79,8 +79,8 @@ BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal template<class IteratorTraversalTag1, class IteratorTraversalTag2> 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::pure_traversal_tag< IteratorTraversalTag1 >::type, + typename boost::iterators::pure_traversal_tag< IteratorTraversalTag2 >::type > { }; diff --git a/boost/range/iterator_range_core.hpp b/boost/range/iterator_range_core.hpp index 8108947724..2fbeb686e2 100644 --- a/boost/range/iterator_range_core.hpp +++ b/boost/range/iterator_range_core.hpp @@ -442,8 +442,8 @@ public: > base_type; template<class Source> - struct is_compatible_range - : is_convertible< + struct is_compatible_range_ + : is_convertible< BOOST_DEDUCED_TYPENAME mpl::eval_if< has_range_iterator<Source>, range_iterator<Source>, @@ -454,6 +454,20 @@ public: { }; + template<class Source> + struct is_compatible_range + : mpl::and_< + mpl::not_< + is_convertible< + Source, + BOOST_DEDUCED_TYPENAME base_type::iterator + > + >, + is_compatible_range_<Source> + > + { + }; + protected: typedef iterator_range_detail::iterator_range_impl<IteratorT> impl; |