#include <iostream> template<int bound, typename T> void f1(T(&ary)[bound]) { T x; for (int i = 0; i < bound; i++) { x = ary[i]; std::cout << x << std::endl; } } int main() { int a[] = { 1, 2, 3, 4, 5, 6 }; f1(a); return 0; }