Use std::copy() rather than std::copy_n() to support pre-C++11 standard libraries

This commit is contained in:
Beman 2015-07-15 16:44:58 -04:00
parent 904e2c3c81
commit 090ab12074

View File

@ -160,7 +160,9 @@ namespace boost {
if ( pos > size())
BOOST_THROW_EXCEPTION( std::out_of_range ( "string_view::copy" ) );
size_type rlen = (std::min)(n, len_ - pos);
std::copy_n(begin() + pos, rlen, s);
// use std::copy(begin() + pos, begin() + pos + rlen, s) rather than
// std::copy_n(begin() + pos, rlen, s) to support pre-C++11 standard libraries
std::copy(begin() + pos, begin() + pos + rlen, s);
return rlen;
}