Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_stringref.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2018-02-28 16:02:25 +0100
committerMartin Hořeňovský2018-02-28 16:02:25 +0100
commit950ccf4749dc3324543c0cba44f85ff81dd300af (patch)
tree756c210868833a6e7212c0d6c144bb85ccf598d4 /include/internal/catch_stringref.cpp
parentcf4b7eead92773932f32c7efd2612e9d27b07557 (diff)
downloadcatch3-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.cpp5
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__)