Boost.Range algorithms are now in the boost::range namespace and brought into boost by the appropriate using statement. This allows better interoperation with Boost.Algorithm since errors only occur when the use calls similarly named ambiguous functions. In this event the user can disambiguate by using algorithm::xxx() or range::xxx(). This iteration also updates the concept assert code in the range algorithms.

[SVN r61023]
This commit is contained in:
Neil Groves
2010-04-03 19:14:13 +00:00
parent b4ae711d4e
commit 22c72c53eb
52 changed files with 2766 additions and 2461 deletions

View File

@ -18,51 +18,56 @@
namespace boost
{
/// \brief template function stable_partition
///
/// range-based version of the stable_partition std algorithm
///
/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
/// \pre UnaryPredicate is a model of the UnaryPredicateConcept
template<class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_iterator<BidirectionalRange>::type
stable_partition(BidirectionalRange& rng, UnaryPredicate pred)
namespace range
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
return std::stable_partition(boost::begin(rng), boost::end(rng), pred);
}
/// \overload
template<class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_iterator<const BidirectionalRange>::type
stable_partition(const BidirectionalRange& rng, UnaryPredicate pred)
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
return std::stable_partition(boost::begin(rng),boost::end(rng),pred);
}
// range_return overloads
template<range_return_value re, class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_return<BidirectionalRange,re>::type
stable_partition(BidirectionalRange& rng, UnaryPredicate pred)
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
return range_return<BidirectionalRange,re>::pack(
std::stable_partition(boost::begin(rng), boost::end(rng), pred),
rng);
}
/// \overload
template<range_return_value re, class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_return<const BidirectionalRange,re>::type
stable_partition(const BidirectionalRange& rng, UnaryPredicate pred)
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
return range_return<const BidirectionalRange,re>::pack(
std::stable_partition(boost::begin(rng),boost::end(rng),pred),
rng);
}
/// \brief template function stable_partition
///
/// range-based version of the stable_partition std algorithm
///
/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
/// \pre UnaryPredicate is a model of the UnaryPredicateConcept
template<class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_iterator<BidirectionalRange>::type
stable_partition(BidirectionalRange& rng, UnaryPredicate pred)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
return std::stable_partition(boost::begin(rng), boost::end(rng), pred);
}
/// \overload
template<class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_iterator<const BidirectionalRange>::type
stable_partition(const BidirectionalRange& rng, UnaryPredicate pred)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
return std::stable_partition(boost::begin(rng),boost::end(rng),pred);
}
// range_return overloads
template<range_return_value re, class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_return<BidirectionalRange,re>::type
stable_partition(BidirectionalRange& rng, UnaryPredicate pred)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
return range_return<BidirectionalRange,re>::pack(
std::stable_partition(boost::begin(rng), boost::end(rng), pred),
rng);
}
/// \overload
template<range_return_value re, class BidirectionalRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_return<const BidirectionalRange,re>::type
stable_partition(const BidirectionalRange& rng, UnaryPredicate pred)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
return range_return<const BidirectionalRange,re>::pack(
std::stable_partition(boost::begin(rng),boost::end(rng),pred),
rng);
}
} // namespace range
using range::stable_partition;
} // namespace boost
#endif // include guard