Title
"::std::" everywhere rule needs tweaking
Status
open
Section
[contents]
Submitter
Tim Song

Created on 2016-11-11.00:00:00 last changed 4 months ago

Messages

Date: 2020-11-22.13:27:34

Proposed resolution:

This wording is relative to N4868.

  1. Modify [contents] as indicated:

    -3- 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: element for library function F is described as calling library function G, the function ::std::G is meant. Whenever an unqualified name x is used in the specification of a declaration D in clauses 16-32 or Annex D, its meaning is established as-if by performing unqualified name lookup ([basic.lookup.unqual]) in the context of D. [Note ?: Argument-dependent lookup is not performed. — end note] Similarly, the meaning of a qualified-id is established as-if by performing qualified name lookup ([basic.lookup.qual]) in the context of D. [Example: The reference to is_array_v in the specification of std::to_array ([array.creation]) refers to ::std::is_array_v. — end example] [Note ?: Operators in expressions ([over.match.oper]) are not so constrained; see [global.functions]. — end note]

  2. Remove [fs.req.namespace] in its entirety:

    29.11.3.2 Namespaces and headers [fs.req.namespace]

    -1- Unless otherwise specified, references to entities described in subclause [filesystems] are assumed to be qualified with ::std::filesystem::.

Date: 2020-11-15.00:00:00

[ 2020-11-22, Tim Song reopens ]

The references to get in [range.subrange.general] and [range.elements.view] need to be qualified as they would otherwise refer to std::ranges::get instead of std::get. Additionally, [expos.only.func] needs to clarify that the lookup there also takes place from within namespace std.

Date: 2020-11-15.00:00:00

[ 2020-11-15; Reflector poll ]

Set priority status to Tentatively Ready after seven votes in favour during reflector discussions.

Date: 2020-11-15.00:00:00

[ 2020-11-06; Reflector discussion ]

Casey suggests to insert "or Annex D" after "in clauses 16-32". This insertion has been performed during reflector discussions immediately because it seemed editorial.

Date: 2020-11-15.00:00:00

[ 2020-11-04; Jens provides improved wording ]

Date: 2020-10-15.00:00:00

[ 2020-10-02; Issue processing telecon: new wording from Jens ]

Use "Simplified suggestion" in 13 June 2020 email from Jens.

Previous resolution [SUPERSEDED]:

This wording is relative to N4849.

  1. Modify [contents] as indicated:

    -3- 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: element for library function F is described as calling library function G, the function ::std::G is meant.Let x be a name specified by the standard library via a declaration in namespace std or in a subnamespace of namespace std. Whenever x is used as an unqualified name in a further specification, it is assumed to correspond to the same x that would be found via unqualified name lookup ([basic.lookup.unqual]) performed at that point of use. Similarly, whenever x is used as a qualified name in a further specification, it is assumed to correspond to the same x that would be found via qualified name lookup ([basic.lookup.qual]) performed at that point of use. [Note: Such lookups can never fail in a well-formed program. — end note] [Example: If an Effects: element for a library function F specifies that library function G is to be used, the function ::std::G is intended. — end example]

Previous resolution [SUPERSEDED]:

This wording is relative to N4849.

  1. Modify [contents] as indicated:

    Drafting note: Consider adding a note clarifying that the unqualified lookup does not perform ADL.

    -3- 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: element for library function F is described as calling library function G, the function ::std::G is meant. Whenever an unqualified name x is used in the specification of a declaration D in clauses 16-32, its meaning is established as-if by performing unqualified name lookup ([basic.lookup.unqual]) in the context of D. Similarly, the meaning of a qualified-id is established as-if by performing qualified name lookup ([basic.lookup.qual]) in the context of D. [Example: The reference to is_array_v in the specification of std::to_array ([array.creation]) refers to ::std::is_array_v. -- end example] [Note: Operators in expressions [over.match.oper] are not so constrained; see [global.functions]. -- end note]

Date: 2020-02-15.00:00:00

[ 2020-02-14, Prague; Walter provides wording ]

Date: 2019-07-22.17:12:46

[ 2019 Cologne Wednesday night ]

Geoffrey suggested editing [contents]/2 to mention the case when we're defining things in a sub-namespace.

Jonathan to word this.

Date: 2017-02-02.00:41:18

[ Issues Telecon 16-Dec-2016 ]

Priority 2; Jonathan to provide wording

Date: 2016-11-11.00:00:00

[contents]/3 says

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.

With the introduction of nested namespaces inside std, this rule needs tweaking. For instance, time_point_cast's Returns clause says "time_point<Clock, ToDuration>(duration_cast<ToDuration>(t.time_since_epoch()))"; that reference to duration_cast obviously means ::std::chrono::duration_cast, not ::std::duration_cast, which doesn't exist.

History
Date User Action Args
2020-11-22 13:27:34adminsetmessages: + msg11632
2020-11-22 13:27:34adminsetstatus: ready -> open
2020-11-15 13:49:21adminsetmessages: + msg11606
2020-11-15 13:49:21adminsetstatus: open -> ready
2020-11-09 18:40:34adminsetmessages: + msg11531
2020-11-08 17:33:22adminsetmessages: + msg11530
2020-10-02 22:43:47adminsetmessages: + msg11504
2020-02-14 07:53:28adminsetmessages: + msg11100
2020-02-14 07:53:28adminsetmessages: + msg11099
2019-07-22 17:12:46adminsetmessages: + msg10486
2019-07-22 17:12:46adminsetstatus: new -> open
2016-12-16 20:56:38adminsetmessages: + msg8748
2016-11-11 00:00:00admincreate