Title
Unqualified references of other library entities
Status
cd1
Section
[contents]
Submitter
Steve Clamage

Created on 2000-04-19.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

[ CuraƧao: An LWG-subgroup spent an afternoon working on issues 225, 226, and 229. Their conclusion was that the issues should be separated into an LWG portion (Howard's paper, N1387=02-0045), and a EWG portion (Dave will write a proposal). The LWG and EWG had (separate) discussions of this plan the next day. This paper resolves issues 225 and 226. In light of that resolution, the proposed resolution for the current issue makes sense. ]

Date: 2010-10-21.18:28:33

[ post-Toronto: Howard is undecided about whether it is appropriate for all standard library function names referred to in other standard library functions to be explicitly qualified by std: it is common advice that users should define global functions that operate on their class in the same namespace as the class, and this requires argument-dependent lookup if those functions are intended to be called by library code. Several LWG members are concerned that valarray appears to require argument-dependent lookup, but that the wording may not be clear enough to fall under "unless explicitly described otherwise". ]

Date: 2010-10-21.18:28:33

[ Post-Tokyo: Steve Clamage submitted this issue at the request of the LWG to solve a problem in the standard itself similar to the problem within implementations of library identified by issue 225. Any resolution of issue 225 should be coordinated with the resolution of this issue. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

To section 17.4.1.1 "Library contents" Add the following paragraph:

Whenever a name x defined in the standard library is mentioned, the name x is assumed to be fully qualified as ::std::x, unless explicitly described otherwise. For example, if the Effects section for library function F is described as calling library function G, the function ::std::G is meant.

Date: 2000-04-19.00:00:00

Throughout the library chapters, the descriptions of library entities refer to other library entities without necessarily qualifying the names.

For example, section 25.2.2 "Swap" describes the effect of swap_ranges in terms of the unqualified name "swap". This section could reasonably be interpreted to mean that the library must be implemented so as to do a lookup of the unqualified name "swap", allowing users to override any ::std::swap function when Koenig lookup applies.

Although it would have been best to use explicit qualification with "::std::" throughout, too many lines in the standard would have to be adjusted to make that change in a Technical Corrigendum.

Issue 182, which addresses qualification of size_t, is a special case of this.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1933
2010-10-21 18:28:33adminsetmessages: + msg1932
2010-10-21 18:28:33adminsetmessages: + msg1931
2010-10-21 18:28:33adminsetmessages: + msg1930
2000-04-19 00:00:00admincreate