yes, allocator is part of the type.

however...

1. you can use strings with polymorphic allocator
2. you can use standard algorithms
3. you can use strcmp() - my favourite option but I like low lever stuff.
4. with cpp17 you can convert string to string view then compare string view's - convertion will be removed from the optimizer and you will get strcmp() under the hood.
5. with cpp11 you can grab a class like string view and use it. https://github.com/nmmmnu/HM4/blob/1.0.0/include/stringref.h (this might not be the newest version i did)

if you have lots of same comparissons, you can also do custom operator == or whatever you need - or with cpp20 you can do tie fighter <=≥ (spaceship operator)

Let me know I can show you some examples if you want, just tell me you want equality or greater / less comparisson.

Nikolay

On Sunday, September 13, 2020, Robert Behar via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
currently I can't compare two strings with differing allocators.