mirror of
https://github.com/matrix-construct/construct
synced 2025-02-16 16:50:12 +01:00
ircd::rfc1459: Add less comparison for char pointer.
This commit is contained in:
parent
3e26e7ab44
commit
fa3d3badb7
1 changed files with 13 additions and 0 deletions
|
@ -71,6 +71,7 @@ using character::tolower;
|
|||
|
||||
struct less
|
||||
{
|
||||
bool operator()(const char *const &a, const char *const &b) const;
|
||||
bool operator()(const std::string &a, const std::string &b) const;
|
||||
bool operator()(const std::string *const &a, const std::string *const &b) const;
|
||||
};
|
||||
|
@ -124,6 +125,18 @@ const
|
|||
});
|
||||
}
|
||||
|
||||
inline bool
|
||||
less::operator()(const char *const &a,
|
||||
const char *const &b)
|
||||
const
|
||||
{
|
||||
return std::lexicographical_compare(a, a + strlen(a), b, b + strlen(b), []
|
||||
(const char &a, const char &b)
|
||||
{
|
||||
return tolower(a) < tolower(b);
|
||||
});
|
||||
}
|
||||
|
||||
inline const unsigned char &
|
||||
character::tolower(const unsigned char &c)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue