Boost.Range brought back some of the const overloads that were over-zealously removed.

[SVN r61495]
This commit is contained in:
Neil Groves
2010-04-22 22:43:57 +00:00
parent 1dea353fa3
commit adc4b5db3b
16 changed files with 552 additions and 22 deletions

View File

@ -35,6 +35,16 @@ inline RandomAccessRange& nth_element(RandomAccessRange& rng,
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& nth_element(const RandomAccessRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type nth)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::nth_element(boost::begin(rng), nth, boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& nth_element(RandomAccessRange& rng,
@ -46,6 +56,17 @@ inline RandomAccessRange& nth_element(RandomAccessRange& rng,
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline const RandomAccessRange& nth_element(const RandomAccessRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type nth,
BinaryPredicate sort_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred);
return rng;
}
} // namespace range
using range::nth_element;
} // namespace boost