Does passing multiple arguments via ::std::initializer_list
offer any advantages over the variadic function template method?
In code:
template <typename T> void f(::std::initializer_list<T> const);
template <typename ...A> void f(A&& ...args);
Note that the types A...
can be restricted to a single type as well, through SFINAE or static_assert()
. The arguments can be iterated through ...