mirror of
https://github.com/boostorg/detail.git
synced 2025-07-29 20:07:15 +02:00
Removed use of deprecated header boost/detail/iterator.hpp.
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
// Copyright (c) 2000 David Abrahams.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright (c) 2000 David Abrahams.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1994
|
||||
// Hewlett-Packard Company
|
||||
//
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
@ -13,10 +13,10 @@
|
||||
// in supporting documentation. Hewlett-Packard Company makes no
|
||||
// representations about the suitability of this software for any
|
||||
// purpose. It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1996
|
||||
// Silicon Graphics Computer Systems, Inc.
|
||||
//
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
@ -24,22 +24,22 @@
|
||||
// in supporting documentation. Silicon Graphics makes no
|
||||
// representations about the suitability of this software for any
|
||||
// purpose. It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
//
|
||||
#ifndef BINARY_SEARCH_DWA_122600_H_
|
||||
# define BINARY_SEARCH_DWA_122600_H_
|
||||
|
||||
# include <boost/detail/iterator.hpp>
|
||||
# include <utility>
|
||||
# include <iterator>
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
template <class ForwardIter, class Tp>
|
||||
ForwardIter lower_bound(ForwardIter first, ForwardIter last,
|
||||
const Tp& val)
|
||||
const Tp& val)
|
||||
{
|
||||
typedef detail::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = boost::detail::distance(first, last);
|
||||
typedef std::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = std::distance(first, last);
|
||||
typename traits::difference_type half;
|
||||
ForwardIter middle;
|
||||
|
||||
@ -62,9 +62,9 @@ template <class ForwardIter, class Tp, class Compare>
|
||||
ForwardIter lower_bound(ForwardIter first, ForwardIter last,
|
||||
const Tp& val, Compare comp)
|
||||
{
|
||||
typedef detail::iterator_traits<ForwardIter> traits;
|
||||
typedef std::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = boost::detail::distance(first, last);
|
||||
typename traits::difference_type len = std::distance(first, last);
|
||||
typename traits::difference_type half;
|
||||
ForwardIter middle;
|
||||
|
||||
@ -87,9 +87,9 @@ template <class ForwardIter, class Tp>
|
||||
ForwardIter upper_bound(ForwardIter first, ForwardIter last,
|
||||
const Tp& val)
|
||||
{
|
||||
typedef detail::iterator_traits<ForwardIter> traits;
|
||||
typedef std::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = boost::detail::distance(first, last);
|
||||
typename traits::difference_type len = std::distance(first, last);
|
||||
typename traits::difference_type half;
|
||||
ForwardIter middle;
|
||||
|
||||
@ -112,9 +112,9 @@ template <class ForwardIter, class Tp, class Compare>
|
||||
ForwardIter upper_bound(ForwardIter first, ForwardIter last,
|
||||
const Tp& val, Compare comp)
|
||||
{
|
||||
typedef detail::iterator_traits<ForwardIter> traits;
|
||||
typedef std::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = boost::detail::distance(first, last);
|
||||
typename traits::difference_type len = std::distance(first, last);
|
||||
typename traits::difference_type half;
|
||||
ForwardIter middle;
|
||||
|
||||
@ -137,9 +137,9 @@ template <class ForwardIter, class Tp>
|
||||
std::pair<ForwardIter, ForwardIter>
|
||||
equal_range(ForwardIter first, ForwardIter last, const Tp& val)
|
||||
{
|
||||
typedef detail::iterator_traits<ForwardIter> traits;
|
||||
typedef std::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = boost::detail::distance(first, last);
|
||||
typename traits::difference_type len = std::distance(first, last);
|
||||
typename traits::difference_type half;
|
||||
ForwardIter middle, left, right;
|
||||
|
||||
@ -169,9 +169,9 @@ std::pair<ForwardIter, ForwardIter>
|
||||
equal_range(ForwardIter first, ForwardIter last, const Tp& val,
|
||||
Compare comp)
|
||||
{
|
||||
typedef detail::iterator_traits<ForwardIter> traits;
|
||||
typedef std::iterator_traits<ForwardIter> traits;
|
||||
|
||||
typename traits::difference_type len = boost::detail::distance(first, last);
|
||||
typename traits::difference_type len = std::distance(first, last);
|
||||
typename traits::difference_type half;
|
||||
ForwardIter middle, left, right;
|
||||
|
||||
@ -194,7 +194,7 @@ equal_range(ForwardIter first, ForwardIter last, const Tp& val,
|
||||
}
|
||||
}
|
||||
return std::pair<ForwardIter, ForwardIter>(first, first);
|
||||
}
|
||||
}
|
||||
|
||||
template <class ForwardIter, class Tp>
|
||||
bool binary_search(ForwardIter first, ForwardIter last,
|
||||
|
@ -8,8 +8,7 @@
|
||||
#ifndef BOOST_DETAIL_SORTED_HPP
|
||||
#define BOOST_DETAIL_SORTED_HPP
|
||||
|
||||
#include <boost/detail/iterator.hpp>
|
||||
|
||||
#include <iterator>
|
||||
#include <functional>
|
||||
|
||||
namespace boost {
|
||||
@ -31,23 +30,23 @@ inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) {
|
||||
|
||||
template<class Iterator>
|
||||
inline Iterator is_sorted_until (Iterator first, Iterator last) {
|
||||
typedef typename boost::detail::iterator_traits<Iterator>::value_type
|
||||
typedef typename std::iterator_traits<Iterator>::value_type
|
||||
value_type;
|
||||
|
||||
typedef std::less<value_type> c;
|
||||
typedef std::less<value_type> c;
|
||||
|
||||
return ::boost::detail::is_sorted_until(first, last, c());
|
||||
return ::boost::detail::is_sorted_until(first, last, c());
|
||||
}
|
||||
|
||||
template<class Iterator, class Comp>
|
||||
inline bool is_sorted (Iterator first, Iterator last, Comp c) {
|
||||
return ::boost::detail::is_sorted_until(first, last, c) == last;
|
||||
}
|
||||
}
|
||||
|
||||
template<class Iterator>
|
||||
inline bool is_sorted (Iterator first, Iterator last) {
|
||||
return ::boost::detail::is_sorted_until(first, last) == last;
|
||||
}
|
||||
}
|
||||
|
||||
} // detail
|
||||
} // boost
|
||||
|
Reference in New Issue
Block a user