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,25 +18,31 @@
namespace boost
{
/// \brief template function transform
///
/// range-based version of the transform std algorithm
///
/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept
/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept
/// \pre OutputIterator is a model of the OutputIteratorConcept
/// \pre UnaryOperation is a model of the UnaryFunctionConcept
/// \pre BinaryOperation is a model of the BinaryFunctionConcept
template< class SinglePassRange1,
class OutputIterator,
class UnaryOperation >
inline OutputIterator
transform(const SinglePassRange1& rng,
OutputIterator out,
UnaryOperation fun)
namespace range
{
return std::transform(boost::begin(rng),boost::end(rng),out,fun);
}
/// \brief template function transform
///
/// range-based version of the transform std algorithm
///
/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept
/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept
/// \pre OutputIterator is a model of the OutputIteratorConcept
/// \pre UnaryOperation is a model of the UnaryFunctionConcept
/// \pre BinaryOperation is a model of the BinaryFunctionConcept
template< class SinglePassRange1,
class OutputIterator,
class UnaryOperation >
inline OutputIterator
transform(const SinglePassRange1& rng,
OutputIterator out,
UnaryOperation fun)
{
BOOST_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
return std::transform(boost::begin(rng),boost::end(rng),out,fun);
}
} // namespace range
namespace range_detail
{
@ -62,24 +68,30 @@ namespace boost
}
}
/// \overload
template< class SinglePassRange1,
class SinglePassRange2,
class OutputIterator,
class BinaryOperation >
inline OutputIterator
transform(const SinglePassRange1& rng1,
const SinglePassRange2& rng2,
OutputIterator out,
BinaryOperation fun)
namespace range
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange1> >();
boost::function_requires< SinglePassRangeConcept<SinglePassRange2> >();
return range_detail::transform_impl(
boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2),
out, fun);
}
}
/// \overload
template< class SinglePassRange1,
class SinglePassRange2,
class OutputIterator,
class BinaryOperation >
inline OutputIterator
transform(const SinglePassRange1& rng1,
const SinglePassRange2& rng2,
OutputIterator out,
BinaryOperation fun)
{
BOOST_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
return range_detail::transform_impl(
boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2),
out, fun);
}
} // namespace range
using range::transform;
} // namespace boost
#endif // include guard