Title
Locale::combine should be const
Status
tc1
Section
[locale.members]
Submitter
Nathan Myers

Created on 1998-08-06.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [locale] and also in [locale.members], add "const" to the declaration of member combine:

template <class Facet> locale combine(const locale& other) const; 
Date: 1998-08-06.00:00:00

locale::combine is the only member function of locale (other than constructors and destructor) that is not const. There is no reason for it not to be const, and good reasons why it should have been const. Furthermore, leaving it non-const conflicts with 22.1.1 paragraph 6: "An instance of a locale is immutable."

History: this member function originally was a constructor. it happened that the interface it specified had no corresponding language syntax, so it was changed to a member function. As constructors are never const, there was no "const" in the interface which was transformed into member "combine". It should have been added at that time, but the omission was not noticed.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg34
1998-08-06 00:00:00admincreate