File indexing completed on 2025-01-30 09:59:16
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_RANGE_ALGORITHM_PARTIAL_SORT_COPY_HPP_INCLUDED
0010 #define BOOST_RANGE_ALGORITHM_PARTIAL_SORT_COPY_HPP_INCLUDED
0011
0012 #include <boost/concept_check.hpp>
0013 #include <boost/range/begin.hpp>
0014 #include <boost/range/end.hpp>
0015 #include <boost/range/concepts.hpp>
0016 #include <boost/range/value_type.hpp>
0017 #include <algorithm>
0018
0019 namespace boost
0020 {
0021 namespace range
0022 {
0023
0024
0025
0026
0027
0028
0029
0030
0031 template<class SinglePassRange, class RandomAccessRange>
0032 inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
0033 partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2)
0034 {
0035 BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
0036
0037 return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
0038 boost::begin(rng2), boost::end(rng2));
0039 }
0040
0041
0042 template<class SinglePassRange, class RandomAccessRange>
0043 inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
0044 partial_sort_copy(const SinglePassRange& rng1, const RandomAccessRange& rng2)
0045 {
0046 BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
0047
0048 return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
0049 boost::begin(rng2), boost::end(rng2));
0050 }
0051
0052
0053 template<class SinglePassRange, class RandomAccessRange,
0054 class BinaryPredicate>
0055 inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
0056 partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2,
0057 BinaryPredicate pred)
0058 {
0059 BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
0060
0061 return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
0062 boost::begin(rng2), boost::end(rng2), pred);
0063 }
0064
0065
0066 template<class SinglePassRange, class RandomAccessRange,
0067 class BinaryPredicate>
0068 inline BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type
0069 partial_sort_copy(const SinglePassRange& rng1, const RandomAccessRange& rng2,
0070 BinaryPredicate pred)
0071 {
0072 BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
0073
0074 return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
0075 boost::begin(rng2), boost::end(rng2), pred);
0076 }
0077
0078 }
0079 using range::partial_sort_copy;
0080 }
0081
0082 #endif