mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 07:39:01 +08:00
[vcpkg] CStringView improvements
This commit is contained in:
parent
5fd834f9b5
commit
5419aebcfe
@ -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>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user