¿Cómo inicializar std :: array <T, n> elegantemente si T no es constructible por defecto?
¿Cómo inicializo?std::array<T, n>
Si T no es constructible por defecto.?
Sé que es posible inicializarlo así:
T t{args};
std::array<T, 5> a{t, t, t, t, t};
Peron
para mi es el parametro de plantilla:
template<typename T, int N>
void f(T value)
{
std::array<T, N> items = ???
}
E incluso si no fuera una plantilla, es bastante feo repetir el valor a mano sin
Es demasiado largo.