aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-04-28 17:27:07 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-04-30 03:27:49 -0700
commit5419aebcfed8cf044f723e07dd785b839fd6bb5b (patch)
tree5dd9a1cfde9e364595e701869d210cc6ed6dd10b
parent5fd834f9b549925b12d496cf65dc42687b5698cc (diff)
downloadvcpkg-5419aebcfed8cf044f723e07dd785b839fd6bb5b.tar.gz
vcpkg-5419aebcfed8cf044f723e07dd785b839fd6bb5b.zip
[vcpkg] CStringView improvements
-rw-r--r--toolsrc/include/CStringView.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/toolsrc/include/CStringView.h b/toolsrc/include/CStringView.h
index af8d683e7..282caad3a 100644
--- a/toolsrc/include/CStringView.h
+++ b/toolsrc/include/CStringView.h
@@ -18,6 +18,30 @@ namespace vcpkg
const CharType* cstr;
};
+ template<class CharType>
+ bool operator==(const std::basic_string<CharType>& l, const BasicCStringView<CharType>& r)
+ {
+ return l == r.c_str();
+ }
+
+ template<class CharType>
+ bool operator==(const BasicCStringView<CharType>& r, const std::basic_string<CharType>& l)
+ {
+ return l == r.c_str();
+ }
+
+ template<class CharType>
+ bool operator!=(const BasicCStringView<CharType>& r, const std::basic_string<CharType>& l)
+ {
+ return l != r.c_str();
+ }
+
+ template<class CharType>
+ bool operator!=(const std::basic_string<CharType>& l, const BasicCStringView<CharType>& r)
+ {
+ return l != r.c_str();
+ }
+
using CStringView = BasicCStringView<char>;
using CWStringView = BasicCStringView<wchar_t>;