DuffsDevice / tiny-utf8

Unicode (UTF-8) capable std::string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Comparison operator doesn't match std::string

evanmoran opened this issue · comments

I noticed this recently and I wanted to bring it up to see if this was intentional. Essentially the less than operator (and probably other operators) aren't matching std::string and I was curious what you thought!

Here's an example:

std::string aaa("aaa");
std::string zz("zz");
auto isLessStdString = aaa < zz;                             // true – expected
auto isLessUtf8String = utf8_string (aaa) < utf8_string(zz); // false – unexpected

Thanks for the great library. It's been really helpful!

Dear Evan,

Thank you for taking the time to write this bug-report and the minimal example.
No, this was definitely not my intention, it might have happened out of pure lightheadedness.

Compare functions are such no-brainers - probably that's why I missed it by a mile ^^
I'm sorry for the inconvenience it has caused you.

It's fixed in the latest commit. I'd be happy to know, if it's working for you now 😊

Thank you so much,
Jakob

Works great for me. Thank you for being so fast :)