0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-18 09:58:22 +02:00

ircd::rfc1459: Add less comparison for char pointer.

This commit is contained in:
Jason Volk 2016-08-23 18:16:14 -07:00
parent 3e26e7ab44
commit fa3d3badb7

View file

@ -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)
{