Can the long explicit initializer list in the following be replaced by some template that generates it?
std::array<Foo, n_foos> foos = {{
{0, bar},
{1, bar},
{2, bar},
{3, bar},
{4, bar},
{5, bar},
{6, bar},
{7, bar},
}};
Now here this code works only because we have constexpr int n_foos = 8
. How can this be done for arbitrary and large n_foos
?