forked from boostorg/range
Boost.Range merge from trunk to release.
This is motivated by the need to correct the istream_range, to correct the adaptors.hpp header file, and correct the return types of various range algorithms. [SVN r61517]
This commit is contained in:
@ -27,40 +27,44 @@ namespace boost
|
||||
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
|
||||
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
|
||||
template<class RandomAccessRange>
|
||||
inline void nth_element(RandomAccessRange& rng,
|
||||
inline RandomAccessRange& nth_element(RandomAccessRange& rng,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type nth)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
|
||||
std::nth_element(boost::begin(rng), nth, boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class RandomAccessRange>
|
||||
inline void nth_element(const RandomAccessRange& rng,
|
||||
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));
|
||||
std::nth_element(boost::begin(rng), nth, boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class RandomAccessRange, class BinaryPredicate>
|
||||
inline void nth_element(RandomAccessRange& rng,
|
||||
inline RandomAccessRange& nth_element(RandomAccessRange& rng,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type nth,
|
||||
BinaryPredicate sort_pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
|
||||
std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred);
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class RandomAccessRange, class BinaryPredicate>
|
||||
inline void nth_element(const RandomAccessRange& rng,
|
||||
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);
|
||||
std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred);
|
||||
return rng;
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
|
Reference in New Issue
Block a user