In the example, a simple lambda is created, which is directly called and will simply return 2 . This will get the third element from the array and assign it 2 . It can be rewritten as follows:
int foo(){ return 2; } int y[5]; y[foo()] = 2;
Or even
int y[5]; auto foo = []{ return 2; };
Now, if the attributes do not exist, the example, of course, will be well-formed, because the section that you quoted will not exist.
source share