Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: third_party/WebKit/Source/wtf/text/StringOperators.h

Issue 2359663002: wtf: Implement StringView specialization of string concatenation. (Closed)
Patch Set: StringImpl::copyChars Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringConcatenate.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringOperators.h
diff --git a/third_party/WebKit/Source/wtf/text/StringOperators.h b/third_party/WebKit/Source/wtf/text/StringOperators.h
index 9100cdaad788a75289554b3585206854c3a3b70e..8b4eac313530b3019cb9df1f911a52423e09074b 100644
--- a/third_party/WebKit/Source/wtf/text/StringOperators.h
+++ b/third_party/WebKit/Source/wtf/text/StringOperators.h
@@ -134,6 +134,11 @@ inline StringAppend<const char*, AtomicString> operator+(const char* string1, co
return StringAppend<const char*, AtomicString>(string1, string2);
}
+inline StringAppend<const char*, StringView> operator+(const char* string1, const StringView& string2)
+{
+ return StringAppend<const char*, StringView>(string1, string2);
+}
+
template<typename U, typename V>
inline StringAppend<const char*, StringAppend<U, V>> operator+(const char* string1, const StringAppend<U, V>& string2)
{
@@ -150,6 +155,11 @@ inline StringAppend<const UChar*, AtomicString> operator+(const UChar* string1,
return StringAppend<const UChar*, AtomicString>(string1, string2);
}
+inline StringAppend<const UChar*, StringView> operator+(const UChar* string1, const StringView& string2)
+{
+ return StringAppend<const UChar*, StringView>(string1, string2);
+}
+
template<typename U, typename V>
inline StringAppend<const UChar*, StringAppend<U, V>> operator+(const UChar* string1, const StringAppend<U, V>& string2)
{
@@ -162,6 +172,18 @@ StringAppend<String, T> operator+(const String& string1, T string2)
return StringAppend<String, T>(string1, string2);
}
+template<typename T>
+StringAppend<AtomicString, T> operator+(const AtomicString& string1, T string2)
+{
+ return StringAppend<AtomicString, T>(string1, string2);
+}
+
+template<typename T>
+StringAppend<StringView, T> operator+(const StringView& string1, T string2)
+{
+ return StringAppend<StringView, T>(string1, string2);
+}
+
template<typename U, typename V, typename W>
StringAppend<StringAppend<U, V>, W> operator+(const StringAppend<U, V>& string1, W string2)
{
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringConcatenate.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698