This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TC1 status.

14. Locale::combine should be const

Section: 30.3.1.4 [locale.members] Status: TC1 Submitter: Nathan Myers Opened: 1998-08-06 Last modified: 2016-08-09

Priority: Not Prioritized

View all other issues in [locale.members].

View all issues with TC1 status.

Discussion:

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.

Proposed resolution:

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

template <class Facet> locale combine(const locale& other) const;