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