diff --git a/include/boost/detail/binary_search.hpp b/include/boost/detail/binary_search.hpp index 3dca9b6..0591563 100644 --- a/include/boost/detail/binary_search.hpp +++ b/include/boost/detail/binary_search.hpp @@ -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 # include +# include namespace boost { namespace detail { template ForwardIter lower_bound(ForwardIter first, ForwardIter last, - const Tp& val) + const Tp& val) { - typedef detail::iterator_traits traits; - - typename traits::difference_type len = boost::detail::distance(first, last); + typedef std::iterator_traits traits; + + typename traits::difference_type len = std::distance(first, last); typename traits::difference_type half; ForwardIter middle; @@ -62,9 +62,9 @@ template ForwardIter lower_bound(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { - typedef detail::iterator_traits traits; + typedef std::iterator_traits 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 ForwardIter upper_bound(ForwardIter first, ForwardIter last, const Tp& val) { - typedef detail::iterator_traits traits; + typedef std::iterator_traits 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 ForwardIter upper_bound(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { - typedef detail::iterator_traits traits; + typedef std::iterator_traits 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 std::pair equal_range(ForwardIter first, ForwardIter last, const Tp& val) { - typedef detail::iterator_traits traits; + typedef std::iterator_traits 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 equal_range(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { - typedef detail::iterator_traits traits; + typedef std::iterator_traits 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(first, first); -} +} template bool binary_search(ForwardIter first, ForwardIter last, diff --git a/include/boost/detail/is_sorted.hpp b/include/boost/detail/is_sorted.hpp index 5ab32e5..84357f9 100644 --- a/include/boost/detail/is_sorted.hpp +++ b/include/boost/detail/is_sorted.hpp @@ -8,8 +8,7 @@ #ifndef BOOST_DETAIL_SORTED_HPP #define BOOST_DETAIL_SORTED_HPP -#include - +#include #include namespace boost { @@ -31,23 +30,23 @@ inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) { template inline Iterator is_sorted_until (Iterator first, Iterator last) { - typedef typename boost::detail::iterator_traits::value_type + typedef typename std::iterator_traits::value_type value_type; - typedef std::less c; + typedef std::less c; - return ::boost::detail::is_sorted_until(first, last, c()); + return ::boost::detail::is_sorted_until(first, last, c()); } template inline bool is_sorted (Iterator first, Iterator last, Comp c) { return ::boost::detail::is_sorted_until(first, last, c) == last; -} +} template inline bool is_sorted (Iterator first, Iterator last) { return ::boost::detail::is_sorted_until(first, last) == last; -} +} } // detail } // boost