Created on 2011-01-03.00:00:00 last changed 130 months ago
[Voted into the WP at the March, 2011 meeting as part of paper N3262.]
By analogy with the variable definition
int arr[3] = {1, 2, 3};
it should be possible to write something like
void f(const int(&)[3]); void g() { f({1, 2, 3}); }
There are currently at least two problems with the latter usage. First, the variable initializer relies on brace elision, which appears to be defined only for variable declarations (9.4.2 [dcl.init.aggr] paragraph 11) , and possibly only for certain forms of variable declarations.
Second, the call would require creation of an array temporary to which the parameter reference would be bound, and the current Standard does not describe array temporaries (although rvalue arrays can occur as members of class rvalues). This is also contrary to the direction established by CWG in considering 1058.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | messages: + msg3351 |
2011-04-10 00:00:00 | admin | set | status: open -> fdis |
2011-01-03 00:00:00 | admin | create |