Title
[[maybe_unused]] and structured bindings
Status
open
Section
10.6.6 [dcl.attr.unused]
Submitter
Michael Wong

Created on 2017-10-19.00:00:00, last changed 2017-10-19.00:00:00.

Messages

Date: 2017-10-19.00:00:00

According to10.6.6 [dcl.attr.unused] paragraph 2,

The attribute may be applied to the declaration of a class, a typedef-name, a variable, a non-static data member, a function, an enumeration, or an enumerator.

This does not include structured bindings, although there seems to be no good reason to prohibit uses like

  [[maybe_unused]] auto [a, b] = std::make_pair(42, 0.23);
History
Date User Action Args
2017-10-19 00:00:00admincreate