[boost][range] - Merge trac resolutions from the trunk. The most notable change is the alteration of the size type to be unsigned. This is a potentially breaking change.

[SVN r78860]
This commit is contained in:
Neil Groves
2012-06-08 22:59:54 +00:00
parent 2f3d82be9f
commit dc46fc13ab
27 changed files with 155 additions and 147 deletions

8
include/boost/range/algorithm_ext/copy_n.hpp Executable file → Normal file
View File

@ -30,15 +30,15 @@ namespace boost
///
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
/// \pre OutputIterator is a model of the OutputIteratorConcept
/// \pre 0 <= n < distance(rng)
/// \pre 0 <= n <= distance(rng)
template< class SinglePassRange, class Size, class OutputIterator >
inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
BOOST_ASSERT( n < static_cast<Size>(boost::distance(rng)) );
BOOST_ASSERT( n <= static_cast<Size>(::boost::distance(rng)) );
BOOST_ASSERT( n >= static_cast<Size>(0) );
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type source = boost::begin(rng);
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type source = ::boost::begin(rng);
for (Size i = 0; i < n; ++i, ++out, ++source)
*out = *source;
@ -47,7 +47,7 @@ inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator
}
} // namespace range
using range::copy_n;
using ::boost::range::copy_n;
} // namespace boost
#endif // include guard