This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
Section: 184.108.40.206 [locale.members] Status: C++17 Submitter: Richard Smith Opened: 2014-06-09 Last modified: 2017-07-30
View all other issues in [locale.members].
View all issues with C++17 status.
220.127.116.11 [locale.members] p5 says:
Returns: The name of *this, if it has one; otherwise, the string "*". If *this has a name, then locale(name().c_str()) is equivalent to *this. Details of the contents of the resulting string are otherwise implementation-defined.
So… what is implementation-defined here, exactly? The first sentence completely defines the behavior of this function in all cases.Also, the second sentence says (effectively) that all locales with the same name are equivalent: given L1 and L2 that have the same name N, they are both equivalent to locale(N), and since there is no definition of "equivalent" specific to locale, I assume it's the normal transitive equivalence property, which would imply that L1 is equivalent to L2. I'm not sure why this central fact is in the description of locale::name, nor why it's written in this roundabout way.
[2016-08-03 Chicago LWG]
Walter, Nevin, and Jason provide initial Proposed Resolution.
[2016-08 - Chicago]
Thurs PM: Moved to Tentatively Ready
This wording is relative to N4606.
Change 18.104.22.168 [locale.members] as indicated:
basic_string<char> name() const;
-5- Returns: The name of *this, if it has one; otherwise, the string "*".
If *this has a name, then locale(name().c_str()) is equivalent to *this. Details of the contents of the resulting string are otherwise implementation-defined.