본문 바로가기

Test Code/C++

[STL] template vector<int>, vector<string> 구분없이 사용하기

// vector<int>, vector<string> 구분없이 사용하기 위해 template 처리

template<class T> 

void display(string str, vector<T> vec)

{

for(auto v:vec)

{

cout << v << endl;

}

}