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 (std::string_view ll, std::string_view rr) noexcept
 

Member Function Documentation

◆ impl()

static constexpr int doj::alphanum_compare::impl ( std::string_view  ll,
std::string_view  rr 
)
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
lNULL-terminated C-style string
rNULL-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: