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,19 +18,25 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
/// \brief template function fill_n
|
||||
///
|
||||
/// range-based version of the fill_n std algorithm
|
||||
///
|
||||
/// \pre ForwardRange is a model of the ForwardRangeConcept
|
||||
template< class ForwardRange, class Size, class Value >
|
||||
inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val)
|
||||
namespace range
|
||||
{
|
||||
boost::function_requires< ForwardRangeConcept<ForwardRange> >();
|
||||
BOOST_ASSERT( static_cast<Size>(std::distance(boost::begin(rng), boost::end(rng))) >= n );
|
||||
std::fill_n(boost::begin(rng), n, val);
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \brief template function fill_n
|
||||
///
|
||||
/// range-based version of the fill_n std algorithm
|
||||
///
|
||||
/// \pre ForwardRange is a model of the ForwardRangeConcept
|
||||
template< class ForwardRange, class Size, class Value >
|
||||
inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val)
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
|
||||
BOOST_ASSERT( static_cast<Size>(std::distance(boost::begin(rng), boost::end(rng))) >= n );
|
||||
std::fill_n(boost::begin(rng), n, val);
|
||||
return rng;
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::fill_n;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
|
Reference in New Issue
Block a user