Chris Forone writes:
> hello group,
>
> why can i initialize a local std::array in this way:
>
> std::array<float, 3> locvar{1.0f, 2.0f, 3.0f};
Because you can't. That's the short answer.
> but as member "only" in this way:
>
> std::array<float, 3> member{{1.0f, 2.0f, 3.0f}};
These are two different things. The first one would be a constructor with
variadic parameters. The second one is a std::initializer_list. It shouldn't
be surpising that something called a "std::initializer_list" would be used
to initialize something.
I suppose that there is no technical reason why a variadic list of
parameters cannot be used to initialize an array or a vector, but that's
just the way it is.