initializer_list and template type deduction
Your first line printme({‘a’, ‘b’, ‘c’}) is illegal because the template argument T could not be inferred. If you explicitly specify the template argument it will work, e.g. printme<vector<char>>({‘a’, ‘b’, ‘c’}) or printme<initializer_list<char>>({‘a’, ‘b’, ‘c’}). The other ones you listed are legal because the argument has a well-defined type, so the template argument T can … Read more