A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/2341.html below:

CWG Issue 2341

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

2341. Structured bindings with static storage durationSection: 9.1  [dcl.pre]     Status: CD5     Submitter: John Spicer     Date: 2017-04-04

[Accepted at the February, 2019 meeting as part of paper P1091R3.]

According to 9.1 [dcl.pre] paragraph 8,

A simple-declaration with an identifier-list is called a structured binding declaration (9.7 [dcl.struct.bind]). The decl-specifier-seq shall contain only the type-specifier auto (9.2.9.7 [dcl.spec.auto]) and cv-qualifiers.

This precludes block-scope structured bindings of static storage duration. However, namespace-scope structured bindings are permitted, and since those have static storage duration, it seems inconsistent to prohibit them at block scope. This restriction also prohibits inline structured bindings, which could be useful.

On the other hand, allowing storage class specifiers raises the question of to what extent they apply to the bindings as opposed to the container variable. That's subtle, because in two out of three cases, the bindings are not variables.

A related issue is that the linkage of structured bindings at namespace scope is not specified.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4