1、front_insert_iterator——用于创建一个可自增减并通过push_front赋值的迭代器对象
#include <iostream> #include <list> #include <algorithm> using namespace std; int main() { list<int> L; L.push_front(3); front_insert_iterator<list<int> > iL(L); *iL++ = 0; *iL++ = 1; *iL++ = 2; copy(L.begin(), L.end(), ostream_iterator<int>(cout, " ")); } 运行结果: // 2 1 0 3