From 090ab120745f553818b71701d0d13085324eaaa1 Mon Sep 17 00:00:00 2001 From: Beman Date: Wed, 15 Jul 2015 16:44:58 -0400 Subject: [PATCH] Use std::copy() rather than std::copy_n() to support pre-C++11 standard libraries --- include/boost/utility/string_view.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }