Skip to content

Instantly share code, notes, and snippets.

@ifukazoo
Created October 26, 2013 10:19
Show Gist options
  • Save ifukazoo/7167692 to your computer and use it in GitHub Desktop.
Save ifukazoo/7167692 to your computer and use it in GitHub Desktop.
リストを出力する.
template<typename T>
void printList(list<T> values)
{
typename list<T>::iterator p;
char separator = 0;
cout << "{ ";
p = values.begin();
while (p != values.end()) {
cout << separator << *p;
separator = ',';
p++;
}
cout << " }" << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment