There's even a little convenience feature: if L is a locale
object, you can compare two strings by writing L(x, y) instead
of going through the nuisance of calling use_facet and then
invoking a collate member function
(c) http://lafstern.org/matt/col2_new.pdf
Круто! Но:
#include <locale>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
locale L = locale::classic();
cout << L("kekeke", "kekeke") << endl;
}
Приводит к:
g++ locale_kekeke.cpp
locale_kekeke.cpp: In function ‘int main(int, char**)’:
locale_kekeke.cpp:8:33: error: no match for call to ‘(std::locale) (const char [7], const char [7])’
8 | cout << L("kekeke", "kekeke") << endl;
| ^
Что он мог иметь ввиду говоря you can compare two strings by writing L(x, y)
?