So I've found this code works:
int foo[] = {0, foo[0] + 1, foo[1] + 2, foo[2] + 4 };
Is this officially legal? I thought that I was making an initializer_list
here, but if I can access previously initialized elements this must be doing aggregate initialization.
I tried to find an official statement on the legality of this, but I couldn't seem to.