Skip to content

Commit 7e88c0b

Browse files
Merge pull request #5848 from MicrosoftDocs/main638986970719104880sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 365d9cb + 8db9075 commit 7e88c0b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/standard-library/locale-class.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
description: "Learn more about: locale Class"
33
title: "locale Class"
4-
ms.date: 06/15/2022
4+
ms.date: 11/13/2025
55
f1_keywords: ["xlocale/std::locale", "xlocale/std::locale::category", "xlocale/std::locale::combine", "xlocale/std::locale::name", "xlocale/std::locale::classic", "xlocale/std::locale::global", "xlocale/std::locale::operator( )", "xlocale/std::locale::facet", "xlocale/std::locale::id"]
66
helpviewer_keywords: ["std::locale [C++]", "std::locale [C++], category", "std::locale [C++], combine", "std::locale [C++], name", "std::locale [C++], classic", "std::locale [C++], global", "std::locale [C++], facet", "std::locale [C++], id"]
7-
ms.assetid: 7dd6d271-472d-4750-8fb5-ea8f55fbef62
87
ms.custom: devdivchpfy22
98
---
109

@@ -92,15 +91,16 @@ messages<wchar_t>
9291

9392
Some of these predefined facets are used by the `iostream` classes, to control the conversion of numeric values to and from text sequences.
9493

95-
An object of class locale also stores a locale name as an object of class [string](../standard-library/string-typedefs.md#string). Using an invalid locale name to construct a locale facet or a locale object throws an object of class [runtime_error](../standard-library/runtime-error-class.md). The stored locale name is `"*"` if the locale object can't be certain that a C-style locale corresponds exactly to the one represented by the object. Otherwise, you can establish a matching locale within the Standard C Library, for some locale object `locale_object`, by calling `setlocale(LC_ALL , locale_object.`[name](#name)`().c_str())`.
96-
97-
In this implementation, you can also call the static member function:
94+
An object of class `locale` also stores a locale name as an object of class [string](../standard-library/string-typedefs.md#string). Using an invalid locale name to construct a locale facet or a locale object throws an object of class [runtime_error](../standard-library/runtime-error-class.md). The stored locale name is `"*"` if the locale object can't be certain that a C-style locale corresponds exactly to the one represented by the object. Otherwise, you can establish a matching locale within the Standard C Library, for some locale object `locale_object`, by calling `setlocale(LC_ALL , locale_object.`[name](#name)`().c_str())`.
9895

9996
```cpp
10097
static locale empty();
10198
```
10299

103-
to construct a locale object that has no facets. It's also a transparent locale. If the template functions [has_facet](../standard-library/locale-functions.md#has_facet) and [use_facet](../standard-library/locale-functions.md#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:
100+
> [!NOTE]
101+
> `locale::empty()` was deprecated starting with Visual Studio 2022 17.14. It'll be removed starting with MSVC Build Tools 14.51. For more information, see [#5834](https://github.com/microsoft/STL/pull/5834).
102+
103+
In this implementation, you can also call the static member function `empty()` to construct a locale object that has no facets. It's also a transparent locale. If the template functions [has_facet](../standard-library/locale-functions.md#has_facet) and [use_facet](../standard-library/locale-functions.md#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:
104104

105105
```cpp
106106
cout.imbue(locale::empty());

0 commit comments

Comments
 (0)