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

@ -35,26 +35,29 @@ inline void push_heap(RandomAccessRange& rng)
/// \overload
template<class RandomAccessRange>
inline void push_heap(const RandomAccessRange& rng)
inline const RandomAccessRange& push_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void push_heap(RandomAccessRange& rng, Compare comp_pred)
inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void push_heap(const RandomAccessRange& rng, Compare comp_pred)
inline const RandomAccessRange& push_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \brief template function pop_heap
@ -64,34 +67,38 @@ inline void push_heap(const RandomAccessRange& rng, Compare comp_pred)
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void pop_heap(RandomAccessRange& rng)
inline RandomAccessRange& pop_heap(RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange>
inline void pop_heap(const RandomAccessRange& rng)
inline const RandomAccessRange& pop_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::pop_heap(boost::begin(rng),boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void pop_heap(RandomAccessRange& rng, Compare comp_pred)
inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void pop_heap(const RandomAccessRange& rng, Compare comp_pred)
inline const RandomAccessRange& pop_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \brief template function make_heap
@ -101,34 +108,38 @@ inline void pop_heap(const RandomAccessRange& rng, Compare comp_pred)
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void make_heap(RandomAccessRange& rng)
inline RandomAccessRange& make_heap(RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange>
inline void make_heap(const RandomAccessRange& rng)
inline RandomAccessRange& make_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::make_heap(boost::begin(rng),boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void make_heap(RandomAccessRange& rng, Compare comp_pred)
inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void make_heap(const RandomAccessRange& rng, Compare comp_pred)
inline const RandomAccessRange& make_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \brief template function sort_heap
@ -138,34 +149,38 @@ inline void make_heap(const RandomAccessRange& rng, Compare comp_pred)
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void sort_heap(RandomAccessRange& rng)
inline RandomAccessRange& sort_heap(RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange>
inline void sort_heap(const RandomAccessRange& rng)
inline const RandomAccessRange& sort_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void sort_heap(RandomAccessRange& rng, Compare comp_pred)
inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void sort_heap(const RandomAccessRange& rng, Compare comp_pred)
inline const RandomAccessRange& sort_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
} // namespace range