It's difference between initialization by ()
and initialization by {}
, in your constructor you should also use {}
initialization.
template <typename ...Tn> wrapper(Tn ...args) : v{args...} {}
By the way, if you want only initializer_list
c-tor, why not simply write this c-tor?
wrapper(std::initializer_list<int> args) : v(args) {}