mirror of
https://github.com/boostorg/range.git
synced 2025-07-28 03:47:40 +02:00
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:
@ -17,29 +17,35 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
/// \brief template function unique_copy
|
||||
///
|
||||
/// range-based version of the unique_copy std algorithm
|
||||
///
|
||||
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
|
||||
/// \pre OutputIterator is a model of the OutputIteratorConcept
|
||||
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
|
||||
template< class SinglePassRange, class OutputIterator >
|
||||
inline OutputIterator
|
||||
unique_copy( const SinglePassRange& rng, OutputIterator out_it )
|
||||
{
|
||||
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
|
||||
return std::unique_copy(boost::begin(rng), boost::end(rng), out_it);
|
||||
}
|
||||
/// \overload
|
||||
template< class SinglePassRange, class OutputIterator, class BinaryPredicate >
|
||||
inline OutputIterator
|
||||
unique_copy( const SinglePassRange& rng, OutputIterator out_it,
|
||||
BinaryPredicate pred )
|
||||
namespace range
|
||||
{
|
||||
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
|
||||
return std::unique_copy(boost::begin(rng), boost::end(rng), out_it, pred);
|
||||
}
|
||||
|
||||
/// \brief template function unique_copy
|
||||
///
|
||||
/// range-based version of the unique_copy std algorithm
|
||||
///
|
||||
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
|
||||
/// \pre OutputIterator is a model of the OutputIteratorConcept
|
||||
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
|
||||
template< class SinglePassRange, class OutputIterator >
|
||||
inline OutputIterator
|
||||
unique_copy( const SinglePassRange& rng, OutputIterator out_it )
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||
return std::unique_copy(boost::begin(rng), boost::end(rng), out_it);
|
||||
}
|
||||
/// \overload
|
||||
template< class SinglePassRange, class OutputIterator, class BinaryPredicate >
|
||||
inline OutputIterator
|
||||
unique_copy( const SinglePassRange& rng, OutputIterator out_it,
|
||||
BinaryPredicate pred )
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||
return std::unique_copy(boost::begin(rng), boost::end(rng), out_it, pred);
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::unique_copy;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
|
Reference in New Issue
Block a user