Remove uses of deprecated header boost/detail/iterator.hpp.

This header was deprecated in favor of <iterator>. It generates compiler
warnings and will be removed in a future release.
This commit is contained in:
Andrey Semashev
2020-05-11 19:13:20 +03:00
parent 994ff83292
commit 3b04f1a65e
2 changed files with 16 additions and 14 deletions

View File

@ -12,6 +12,8 @@
#include <cstddef>
#include <string>
#include <utility>
#include <iterator>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_const.hpp>
@ -22,7 +24,6 @@
#include <boost/mpl/identity.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/detail/iterator.hpp>
// 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<element_type>::value_type value_type;
typedef typename
std::iterator_traits<element_type>::value_type value_type;
typedef std::size_t size_type;
typedef typename ::boost::detail::
iterator_traits<element_type>::difference_type difference_type;
typedef typename
std::iterator_traits<element_type>::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<char>::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 )

View File

@ -28,6 +28,7 @@
#include <boost/config.hpp>
#include <vector>
#include <fstream>
#include <iterator>
#include <algorithm>
namespace
@ -146,7 +147,7 @@ void check_char()
char* char_s2 = a_string.mutable_sz();
BOOST_STATIC_ASSERT(( is_same< range_value<char_iterator_t>::type,
detail::iterator_traits<char_iterator_t>::value_type>::value ));
std::iterator_traits<char_iterator_t>::value_type>::value ));
BOOST_STATIC_ASSERT(( is_same< range_iterator<char_iterator_t>::type, char_iterator_t >::value ));
BOOST_STATIC_ASSERT(( is_same< range_difference<char_iterator_t>::type,
@ -225,11 +226,11 @@ void check_string()
wchar_t* char_ws2 = a_wide_string.mutable_sz();
BOOST_STATIC_ASSERT(( is_same< range_value<wchar_iterator_t>::type,
detail::iterator_traits<wchar_iterator_t>::value_type>::value ));
std::iterator_traits<wchar_iterator_t>::value_type>::value ));
BOOST_STATIC_ASSERT(( is_same< range_iterator<wchar_iterator_t>::type, wchar_iterator_t >::value ));
BOOST_STATIC_ASSERT(( is_same< range_iterator<const wchar_t*>::type, const wchar_t* >::value ));
BOOST_STATIC_ASSERT(( is_same< range_difference<wchar_iterator_t>::type,
detail::iterator_traits<wchar_iterator_t>::difference_type >::value ));
std::iterator_traits<wchar_iterator_t>::difference_type >::value ));
BOOST_STATIC_ASSERT(( is_same< range_size<wchar_iterator_t>::type, std::size_t >::value ));
BOOST_STATIC_ASSERT(( is_same< range_iterator<wchar_iterator_t>::type, wchar_iterator_t >::value ));
BOOST_STATIC_ASSERT(( is_same< range_iterator<const wchar_t*>::type, const wchar_t* >::value ));