fork download
#include 
#include 
#include 

template 
void printAll(const T& v)
{
    for (const typename T::value_type& value : v)
        std::cout << value << std::endl;
}

int main()
{
    std::array a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    printAll(a);
    
    std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    printAll(v);
}
Success #stdin #stdout 0s 2984KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10