StringRef will not take ownership when writing itself to stream

This also fixes some tests that were previously failing unnoticed - WTF?
This commit is contained in:
Martin Hořeňovský 2018-02-17 20:41:50 +01:00
parent 5a8f9c84dd
commit 4e57661919
6 changed files with 71 additions and 28 deletions

View file

@ -112,7 +112,7 @@ namespace Catch {
}
auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
return os << str.c_str();
return os.write(str.m_start, str.m_size);
}
} // namespace Catch