diff options
| author | Martin Hořeňovský | 2018-02-28 16:02:25 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-02-28 16:02:25 +0100 |
| commit | 950ccf4749dc3324543c0cba44f85ff81dd300af (patch) | |
| tree | 756c210868833a6e7212c0d6c144bb85ccf598d4 /include/internal/catch_stringref.cpp | |
| parent | cf4b7eead92773932f32c7efd2612e9d27b07557 (diff) | |
| download | catch3-950ccf4749dc3324543c0cba44f85ff81dd300af.tar.gz | |
StringRef appends itself to std::string efficiently
Diffstat (limited to 'include/internal/catch_stringref.cpp')
| -rw-r--r-- | include/internal/catch_stringref.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/internal/catch_stringref.cpp b/include/internal/catch_stringref.cpp index 604e8465..46b25039 100644 --- a/include/internal/catch_stringref.cpp +++ b/include/internal/catch_stringref.cpp @@ -115,6 +115,11 @@ namespace Catch { return os.write(str.m_start, str.m_size); } + auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& { + lhs.append(rhs.m_start, rhs.m_size); + return lhs; + } + } // namespace Catch #if defined(__clang__) |