I asked a question here: Lifetime Extension of a initializer_list return involving the non-functional code:
const auto foo = [](const auto& a, const auto
I just thought that any time you did a curly-braced list you were creating an
intializer_list
.
That's not correct.
If that's not what's happening, what is a list in curly-braces?
struct Foo {int a; int b;};
Foo f = {10, 20};
The {10, 20}
part is not an initializer_list
. It's just a syntactic form to use a list of objects to create another object.
int a[] = {10, 20, 30};
Once again, it's a syntactic form to create an array.
The name for the syntactic form is braced-init-list.