forked from boostorg/range
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:
@ -18,27 +18,33 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
/// \brief template function reverse
|
||||
///
|
||||
/// range-based version of the reverse std algorithm
|
||||
///
|
||||
/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
|
||||
template<class BidirectionalRange>
|
||||
inline BidirectionalRange& reverse(BidirectionalRange& rng)
|
||||
namespace range
|
||||
{
|
||||
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
|
||||
std::reverse(boost::begin(rng), boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class BidirectionalRange>
|
||||
inline const BidirectionalRange& reverse(const BidirectionalRange& rng)
|
||||
{
|
||||
boost::function_requires< BidirectionalRangeConcept<BidirectionalRange> >();
|
||||
std::reverse(boost::begin(rng), boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
/// \brief template function reverse
|
||||
///
|
||||
/// range-based version of the reverse std algorithm
|
||||
///
|
||||
/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
|
||||
template<class BidirectionalRange>
|
||||
inline BidirectionalRange& reverse(BidirectionalRange& rng)
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
|
||||
std::reverse(boost::begin(rng), boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class BidirectionalRange>
|
||||
inline const BidirectionalRange& reverse(const BidirectionalRange& rng)
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
|
||||
std::reverse(boost::begin(rng), boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::reverse;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
|
Reference in New Issue
Block a user