From 3b04f1a65eb3c78472e2aed6ea6b93978017f777 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 11 May 2020 19:13:20 +0300 Subject: [PATCH] Remove uses of deprecated header boost/detail/iterator.hpp. This header was deprecated in favor of . It generates compiler warnings and will be removed in a future release. --- .../range/detail/collection_traits_detail.hpp | 23 ++++++++++--------- test/string.cpp | 7 +++--- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/boost/range/detail/collection_traits_detail.hpp b/include/boost/range/detail/collection_traits_detail.hpp index 2dc97f1..5a3124b 100644 --- a/include/boost/range/detail/collection_traits_detail.hpp +++ b/include/boost/range/detail/collection_traits_detail.hpp @@ -12,6 +12,8 @@ #include #include +#include +#include #include #include #include @@ -22,7 +24,6 @@ #include #include #include -#include // Container traits implementation --------------------------------------------------------- @@ -36,7 +37,7 @@ namespace boost { /* Wraps std::container compliant containers */ - template< typename ContainerT > + template< typename ContainerT > struct default_container_traits { typedef typename ContainerT::value_type value_type; @@ -49,7 +50,7 @@ namespace boost { >::type result_iterator; typedef typename ContainerT::difference_type difference_type; typedef typename ContainerT::size_type size_type; - + // static operations template< typename C > static size_type size( const C& c ) @@ -120,11 +121,11 @@ namespace boost { { typedef typename PairT::first_type element_type; - typedef typename ::boost::detail:: - iterator_traits::value_type value_type; + typedef typename + std::iterator_traits::value_type value_type; typedef std::size_t size_type; - typedef typename ::boost::detail:: - iterator_traits::difference_type difference_type; + typedef typename + std::iterator_traits::difference_type difference_type; typedef element_type iterator; typedef element_type const_iterator; @@ -186,7 +187,7 @@ namespace boost { BOOST_STATIC_CONSTANT( size_type, array_size = sz ); }; - + // array length resolving /* Lenght of string contained in a static array could @@ -243,7 +244,7 @@ namespace boost { else return std::char_traits::length(a); } - + template< typename A > static bool empty( const A& a ) { @@ -303,7 +304,7 @@ namespace boost { const_iterator, iterator >::type result_iterator; - + private: // resolve array size typedef typename @@ -327,7 +328,7 @@ namespace boost { { return array_length_type::empty(a); } - + template< typename A > static iterator begin( A& a ) diff --git a/test/string.cpp b/test/string.cpp index 9ff13f9..b6c44f0 100644 --- a/test/string.cpp +++ b/test/string.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace @@ -146,7 +147,7 @@ void check_char() char* char_s2 = a_string.mutable_sz(); BOOST_STATIC_ASSERT(( is_same< range_value::type, - detail::iterator_traits::value_type>::value )); + std::iterator_traits::value_type>::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, char_iterator_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, @@ -225,11 +226,11 @@ void check_string() wchar_t* char_ws2 = a_wide_string.mutable_sz(); BOOST_STATIC_ASSERT(( is_same< range_value::type, - detail::iterator_traits::value_type>::value )); + std::iterator_traits::value_type>::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, wchar_iterator_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const wchar_t* >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, - detail::iterator_traits::difference_type >::value )); + std::iterator_traits::difference_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, wchar_iterator_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const wchar_t* >::value ));