You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
We talked about this at the weekly maintainer meeting. Unconditionally deprecating now, and later guarding the declaration with #ifdef _CRTBLD to conceal it from users, seems like a reasonable strategy. If we see lots of RWC impact from the deprecation, then we can revise this plan, but I suspect that real-world usage will be very unlikely, even though this has been provided for decades.
We've also contacted the docs team to stop documenting locale::empty().
The
std::locale
class provides a memberempty
, which is not part of the standard.STL/stl/inc/xlocale
Line 403 in 89ca073
This member is documented on https://learn.microsoft.com/en-us/cpp/standard-library/locale-class?view=msvc-170:
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?
The text was updated successfully, but these errors were encountered: