C++11 Implicit conversion from initialization list to array parameter
In C++11, is it possible to do something similar to the following? template<typename T, size_t N> void foo(array<T, N> src) { ... } ... foo({1, 2, 3}) I'm currently running GCC 4.8. Ali Yes , I managed to get the following work (since you allow something similar ): template<typename T, size_t N> void foo(array<T, N> src) { ... } ... foo('a', 'b'); foo(1, 2, 3); Here is how: #include <array> #include <iostream> #include <utility> using namespace std; template<typename T, unsigned long N> void foo(array<T,N> src) { for (auto e : src) cout << e << endl; } template<class T, class... Tail> auto