You can initialize std::vector<T> with list initialization. However, you cannot output the template argument T using std::vector<T> in the argument list and pass a function that is not std::vector<T> . For example, this works:
#include <vector> template <typename T> struct A { void f(const std::vector<T> &) {} }; int main() { A<int> a; af({ 1, 2, 3 }); }
source share