summaryrefslogtreecommitdiff
path: root/src/string.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.hh')
-rw-r--r--src/string.hh34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/string.hh b/src/string.hh
index b1e51e7e..5e90e98d 100644
--- a/src/string.hh
+++ b/src/string.hh
@@ -20,23 +20,6 @@ class StringOps
public:
using value_type = CharType;
- [[gnu::always_inline]]
- friend bool operator==(const Type& lhs, const Type& rhs)
- {
- return lhs.length() == rhs.length() and
- std::equal(lhs.begin(), lhs.end(), rhs.begin());
- }
-
- [[gnu::always_inline]]
- friend bool operator!=(const Type& lhs, const Type& rhs)
- { return not (lhs == rhs); }
-
- friend bool operator<(const Type& lhs, const Type& rhs)
- {
- return std::lexicographical_compare(lhs.begin(), lhs.end(),
- rhs.begin(), rhs.end());
- }
-
friend inline size_t hash_value(const Type& str)
{
return hash_data(str.data(), (int)str.length());
@@ -220,6 +203,23 @@ inline String operator+(StringView lhs, StringView rhs)
return res;
}
+[[gnu::always_inline]]
+inline bool operator==(const StringView& lhs, const StringView& rhs)
+{
+ return lhs.length() == rhs.length() and
+ std::equal(lhs.begin(), lhs.end(), rhs.begin());
+}
+
+[[gnu::always_inline]]
+inline bool operator!=(const StringView& lhs, const StringView& rhs)
+{ return not (lhs == rhs); }
+
+inline bool operator<(const StringView& lhs, const StringView& rhs)
+{
+ return std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end());
+}
+
Vector<String> split(StringView str, char separator, char escape);
Vector<StringView> split(StringView str, char separator);