Can I use this comparator for "C" unicode strings?
#include <iostream> #include <algorithm> class StrCmp { public: template <typename T> bool operator() (const T* p1, const T* p2) const { while (*p1 && *p2 && *p1 == *p2) ++p1, ++p2; return *p2 > *p1; } }; int main(int argc, char* argv[] ) { const char32_t* a[] { U"ЁЁЁ", U"АААААА", U"А", U"ЁЁЁ", U"ЁЁЁЁЁЁЁ", U"ААА" }; std::sort(a, a + 6, StrCmp() ); return 0; } if you can not why.