Created on 2019-12-06.00:00:00 last changed 60 months ago
Proposed resolution:
This wording is relative to N4842.
Modify [locale] as indicated:
[…] ~locale(); // not virtualconstlocale& operator=(const locale& other) noexcept; template<class Facet> locale combine(const locale& other) const; […]
Modify [locale.cons] as indicated:
constlocale& operator=(const locale& other) noexcept;-14- Effects: Creates a copy of other, replacing the current value.
-15- Returns: *this.
[ 2019-12-21 Issue Prioritization ]
Priority to 3 after reflector discussion based on the observation that we have implementation divergence.
Curiously, locale's copy assignment operator currently returns const locale&. As Casey Carter noted in microsoft/STL#268, this is:
Weird!
The only occurrence in the entire Standard Library.
Preventing locale from satisfying std::copyable.
We aren't aware of any reason for this to be const. (I observe that this hasn't changed since N1804 on 2005-04-27 and probably goes back to C++98; I suspect that when this was originally specified, copy assignment operators were relatively new, and conventions for them weren't rigorously followed.)
History | |||
---|---|---|---|
Date | User | Action | Args |
2019-12-21 14:14:21 | admin | set | messages: + msg10896 |
2019-12-07 18:23:16 | admin | set | messages: + msg10870 |
2019-12-06 00:00:00 | admin | create |