From ef5aa728b09a161a19d3ad92c22dbb3573cca8d3 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Mon, 8 Apr 2013 17:45:03 +0900 Subject: [PATCH] fix string_ref io --- sprout/utility/string_ref/io.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sprout/utility/string_ref/io.hpp b/sprout/utility/string_ref/io.hpp index 6efb4c90..e79eccf2 100644 --- a/sprout/utility/string_ref/io.hpp +++ b/sprout/utility/string_ref/io.hpp @@ -1,6 +1,8 @@ #ifndef SPROUT_UTILITY_STRING_IO_HPP #define SPROUT_UTILITY_STRING_IO_HPP +#include +#include #include #include #include @@ -12,7 +14,8 @@ namespace sprout { template inline std::basic_ostream& operator<<(std::basic_ostream& lhs, sprout::basic_string_ref const& rhs) { - return lhs << rhs.c_str(); + std::copy(rhs.begin(), rhs.end(), std::ostreambuf_iterator(lhs)); + return lhs; } } // namespace sprout