Loading...
Searching...
No Matches
doj::alphanum_compare Struct Reference
Public Member Functions | |
constexpr bool | operator() (std::string_view l, std::string_view r) const noexcept |
Static Public Member Functions | |
static constexpr bool | alphanum_isdigit (const char c) noexcept |
static constexpr int | impl (const std::string_view ll, const std::string_view rr) noexcept |
Member Function Documentation
◆ impl()
|
inlinestaticconstexprnoexcept |
compare l and r with strcmp() semantics, but using the "Alphanum Algorithm". This function is designed to read through the l and r strings only one time, for maximum performance. It does not allocate memory for substrings. It can either use the C-library functions isdigit() and atoi() to honour your locale settings, when recognizing digit characters when you "#define ALPHANUM_LOCALE=1" or use it's own digit character handling which only works with ASCII digit characters, but provides better performance.
- Parameters
-
l NULL-terminated C-style string r NULL-terminated C-style string
- Returns
- negative if l<r, 0 if l equals r, positive if l>r
The documentation for this struct was generated from the following file: