File indexing completed on 2025-01-18 09:51:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_RANGE_ALGORITHM_EXT_IS_SORTED_HPP_INCLUDED
0011 #define BOOST_RANGE_ALGORITHM_EXT_IS_SORTED_HPP_INCLUDED
0012
0013 #include <boost/concept_check.hpp>
0014 #include <boost/range/begin.hpp>
0015 #include <boost/range/end.hpp>
0016 #include <boost/range/concepts.hpp>
0017 #include <boost/range/value_type.hpp>
0018 #include <boost/detail/is_sorted.hpp>
0019 #include <algorithm>
0020
0021 namespace boost
0022 {
0023 namespace range
0024 {
0025
0026
0027
0028
0029
0030
0031 template<class SinglePassRange>
0032 inline bool is_sorted(const SinglePassRange& rng)
0033 {
0034 BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
0035 BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept<BOOST_DEDUCED_TYPENAME
0036 range_value<const SinglePassRange>::type>));
0037 return ::boost::detail::is_sorted(boost::begin(rng), boost::end(rng));
0038 }
0039
0040
0041 template<class SinglePassRange, class BinaryPredicate>
0042 inline bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred)
0043 {
0044 BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
0045 BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate,
0046 BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type,
0047 BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type>));
0048 return ::boost::detail::is_sorted(boost::begin(rng), boost::end(rng), pred);
0049 }
0050
0051 }
0052
0053 using range::is_sorted;
0054
0055 }
0056
0057 #endif