[vcpkg] CStringView improvements

This commit is contained in:
Robert Schumacher 2017-04-28 17:27:07 -07:00
parent 5fd834f9b5
commit 5419aebcfe

View File

@ -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>;