Код: Выделить всё
namespace std
{
template
class ctype : public std::ctype_base
{
public:
static std::locale::id id;
// other members
};
}
Код: Выделить всё
using my_ctype = std::ctype;
std::locale custom_loc(std::locale::classic(), new my_ctype());
auto my_facet = &std::use_facet(custom_loc);
std::locale default_loc(std::locale(""), new my_ctype());
std::locale with_original_ctype(default_loc, custom_loc, std::locale::ctype);
bool b = my_facet == &std::use_facet(with_original_ctype); // false
std::locale everything_replaced(custom_loc, default_loc, std::locale::all);
bool c = my_facet == &std::use_facet(everything_replaced); // true
Как сделать так, чтобы фасет правильно интерпретировался как находящийся в категории std::locale::ctype?
Подробнее здесь: https://stackoverflow.com/questions/786 ... lecategory