diff options
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/CStringView.h | 24 |
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>; |
