-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
The std::locale class provides a member empty, which is not part of the standard.
Line 403 in 89ca073
| static _MRTIMP2_PURE locale __CLRCALL_PURE_OR_CDECL empty(); // empty (transparent) locale |
This member is documented on https://learn.microsoft.com/en-us/cpp/standard-library/locale-class?view=msvc-170:
In this implementation, you can also call the static member function:
static locale empty();to construct a locale object that has no facets. It's also a transparent locale. If the template functions has_facet and use_facet can't find the requested facet in a transparent locale, they consult first the global locale and then, if that is transparent, the classic locale. So, you can write:
cout.imbue(locale::empty());Subsequent insertions to cout are mediated by the current state of the global locale.
It seems that this member is used by a few projects to read UTF-8 files, possibly (mis)guided by https://stackoverflow.com/a/10607146/4672588.
Is there any interest to deprecate and eventually remove this non-Standard extension?