From 5419aebcfed8cf044f723e07dd785b839fd6bb5b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 28 Apr 2017 17:27:07 -0700 Subject: [vcpkg] CStringView improvements --- toolsrc/include/CStringView.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'toolsrc/include/CStringView.h') 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 + bool operator==(const std::basic_string& l, const BasicCStringView& r) + { + return l == r.c_str(); + } + + template + bool operator==(const BasicCStringView& r, const std::basic_string& l) + { + return l == r.c_str(); + } + + template + bool operator!=(const BasicCStringView& r, const std::basic_string& l) + { + return l != r.c_str(); + } + + template + bool operator!=(const std::basic_string& l, const BasicCStringView& r) + { + return l != r.c_str(); + } + using CStringView = BasicCStringView; using CWStringView = BasicCStringView; -- cgit v1.2.3