Boost.Range updated the return types of various algorithms to improve consistency. This is to address a specific request made during the formal review of Boost.RangeEx.

[SVN r61211]
This commit is contained in:
Neil Groves
2010-04-11 22:05:02 +00:00
parent cab01e8ba3
commit 350a1f8bfc
108 changed files with 937 additions and 605 deletions

View File

@ -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));
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);
return rng;
}
} // namespace range