Date: Tue, 10 Nov 2026 21:06:55 +0100
You could create a constexpr helper function, which receives pairs of numbers (index, value)?
-----Ursprüngliche Nachricht-----
Von:Comical USA via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Di 10.11.2026 21:04
Betreff:[std-proposals] Add array data initialization like in C
An:std-proposals_at_[hidden];
CC:Comical USA <comicalusa_at_[hidden]>;
In C you can do
int a[5] = {
[3] = 2,
};
which will make the array 0, 0, 2, 0, 0
but on C++ you can do that only with lambda or like this int a[] = { 0, 0, 2, 0, 0 } or after initializating you must do a[3] = 2; and it's pretty annoying, can we get in C++29 this C feature?
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2026-11-10 20:08:19
