Movatterモバイル変換


[0]ホーム

URL:


Issue 2289 - WG21 CWG Issues
Title
Uniqueness of structured binding names
Status
cd5
Section
_N4868_.6.4.1 [basic.scope.declarative]
Submitter
Richard Smith

Created on2016-07-20.00:00:00 last changed62 months ago

Messages

msg6354 (view)
Date: 2019-02-15.00:00:00

Proposed resolution (February, 2019):

Change _N4868_.6.4.1 [basic.scope.declarative] paragraph 4 as follows:

Given a set of declarations in a single declarative region,each of which specifies the same unqualified name,

  • they shall all refer to the same entity, or all refer tofunctions and function templates; or

  • exactly one declaration shall declare a class name orenumeration name that is not a typedef name and the otherdeclarations shall all refer to the same variable,non-static data member, or enumerator, or all refer tofunctions and function templates; in this case the classname or enumeration name is hidden(_N4868_.6.4.10 [basic.scope.hiding]). [Note:Astructured binding (9.7 [dcl.struct.bind]),namespace name(9.9 [basic.namespace]),ora class templatename(Clause 13 [temp]) must beunique in its declarativeregion(9.9.3 [namespace.alias],Clause 13 [temp]). —endnote]

msg5893 (view)
Date: 2017-04-15.00:00:00

Notes from the April, 2017 teleconference:

Structured bindings have no C compatibility implications, so thetag/nontag treatment need not apply.

msg5892 (view)
Date: 2019-02-15.00:00:00

[Accepted as a DR at the February, 2019 meeting.]

The current wording is not clear regarding examples likethe following:

  struct A { int x; } a;  struct B {} b; template<int> int &get(const B&);  struct C {}; int c[1];  auto [A] = a; // ok?  auto [B] = b; // ok?  auto [C] = c; // ok?
History
DateUserActionArgs
2020-12-15 00:00:00adminsetmessages: +msg6354
2020-12-15 00:00:00adminsetstatus: drafting -> cd5
2018-02-27 00:00:00adminsetmessages: +msg5893
2016-07-20 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp