diff --git a/include/boost/utility/string_view.hpp b/include/boost/utility/string_view.hpp index bc5055a..cc86b8e 100644 --- a/include/boost/utility/string_view.hpp +++ b/include/boost/utility/string_view.hpp @@ -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; }