front_inserter example int main() { list l; copy(istream_iterator(cin), istream_iterator(), front_inserter(l)); copy(l.begin(), l.end(), ostream_iterator(cout, ", ")); cout << endl; } Input: 2 63 42 1 8 Output: 8, 1, 42, 63, 2