I have following template function:
template<typename T> void foo2(T t) {}
I know that I cannot call it using:
foo2({1,2,3});
because initializer list is a non deduced context for a template argument. I have to use:
foo2<std::initializer_list<int>>({1,2,3});
but I can also use:
foo2(std::initializer_list<int>({1,2,3}));
which makes me wonder what is the difference between: {1,2,3}
and std::initializer_list<int>({1,2,3})
?