[P2174]
Compound Literals
https://wg21.link/P2174
EWG put a break on the proposal in Nov 2022.
https://github.com/cplusplus/papers/issues/883#issuecomment-1308098822
I think the author is so clever to come up with “casting” expression to turn a braced-init-list
into an lvalue
so you could do a code sugar like c23
compound literals
…
char *ptr = strcat((char [100]){0}, "like this");
I think this approach is even independent to [P2752]
, braced-init-list
now got back-storage promotion optimization possibility, with contrained access as before, of course.
[P2752]
Static storage for braced initializers
https://wg21.link/P2752
[P2752]
even now already got into c++26
last year (2023).
https://github.com/cplusplus/papers/issues/1442#issuecomment-1591576390
Considering this, if in c++26
, a braced-init-list
candidate is considered safely to be backed by static storage, wouldn’t it simply “make sense” that a “cast” of it, is just an lvalue
copied from it in this particular case?
What are drawbacks of this “cast” approach, or even what are drawbacks of c23
-like compound literals
code sugar in c++
realm?