BLI: add comparison operators for StringRef
The semantic of those is the same as for std::string_view.
This commit is contained in:
parent
0774fdbeb6
commit
d71458d919
|
@ -404,6 +404,26 @@ inline bool operator!=(StringRef a, StringRef b)
|
|||
return !(a == b);
|
||||
}
|
||||
|
||||
inline bool operator<(StringRef a, StringRef b)
|
||||
{
|
||||
return std::string_view(a) < std::string_view(b);
|
||||
}
|
||||
|
||||
inline bool operator>(StringRef a, StringRef b)
|
||||
{
|
||||
return std::string_view(a) > std::string_view(b);
|
||||
}
|
||||
|
||||
inline bool operator<=(StringRef a, StringRef b)
|
||||
{
|
||||
return std::string_view(a) <= std::string_view(b);
|
||||
}
|
||||
|
||||
inline bool operator>=(StringRef a, StringRef b)
|
||||
{
|
||||
return std::string_view(a) >= std::string_view(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true when the string starts with the given prefix.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue