I am not sure if this is clever enough, but in the case you could use boost preprocessor to create the code as described in you example:
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#define INIT(z, n, initializer)(initializer(n))
#define INIT_ARRAY(N, INITIALIZER) {BOOST_PP_SEQ_ENUM(BOOST_PP_REPEAT(5, INIT, Bar))}
struct Bar
{
constexpr Bar(int ii) : i(ii) {}
int i;
};
Bar data[] = INIT_ARRAY(5, Bar);
In general you can solve a lot of repetitive problems this way, but you often makes the code more complex and it less obvious what happens. So you should do this only if you have a lot of such think.
Of course you can also do some metaprogramming, which can lead to quite long compile times