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

@ -17,52 +17,58 @@
namespace boost
{
/// \brief template function inplace_merge
///
/// range-based version of the inplace_merge std algorithm
///
/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template<class BidirectionalRange>
inline BidirectionalRange& inplace_merge(BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<BidirectionalRange>::type middle)
namespace range
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
std::inplace_merge(boost::begin(rng), middle, boost::end(rng));
return rng;
}
/// \overload
template<class BidirectionalRange>
inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME boost::range_iterator<const BidirectionalRange>::type middle)
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
std::inplace_merge(boost::begin(rng), middle, boost::end(rng));
return rng;
}
/// \overload
template<class BidirectionalRange, class BinaryPredicate>
inline BidirectionalRange& inplace_merge(BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME boost::range_iterator<BidirectionalRange>::type middle,
BinaryPredicate pred)
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred);
return rng;
}
/// \overload
template<class BidirectionalRange, class BinaryPredicate>
inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME boost::range_iterator<const BidirectionalRange>::type middle,
BinaryPredicate pred)
{
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred);
return rng;
}
/// \brief template function inplace_merge
///
/// range-based version of the inplace_merge std algorithm
///
/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template<class BidirectionalRange>
inline BidirectionalRange& inplace_merge(BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<BidirectionalRange>::type middle)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
std::inplace_merge(boost::begin(rng), middle, boost::end(rng));
return rng;
}
/// \overload
template<class BidirectionalRange>
inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME boost::range_iterator<const BidirectionalRange>::type middle)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
std::inplace_merge(boost::begin(rng), middle, boost::end(rng));
return rng;
}
/// \overload
template<class BidirectionalRange, class BinaryPredicate>
inline BidirectionalRange& inplace_merge(BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME boost::range_iterator<BidirectionalRange>::type middle,
BinaryPredicate pred)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred);
return rng;
}
/// \overload
template<class BidirectionalRange, class BinaryPredicate>
inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng,
BOOST_DEDUCED_TYPENAME boost::range_iterator<const BidirectionalRange>::type middle,
BinaryPredicate pred)
{
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred);
return rng;
}
} // namespace range
using range::inplace_merge;
} // namespace boost
#endif // include guard