[boost][range] - Improved handling of temporary ranges in range algorithms.

[SVN r63902]
This commit is contained in:
Neil Groves
2010-07-12 00:08:41 +00:00
parent db345d4e8e
commit ef000176d8
36 changed files with 649 additions and 27 deletions

View File

@ -36,6 +36,16 @@ inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val)
return rng;
}
/// \overload
template< class ForwardRange, class Size, class Value >
inline const ForwardRange& fill_n(const ForwardRange& rng, Size n, const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const 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