increment/decrement: operator++/operator--


标准形式 

T& operator++(); // ++ 前缀

T& operator --(); // -- 前缀

const T operator++(int); // ++ 后缀

const T operator--(int); // -- 后缀

// l 是 list<int>, i 是合法的迭代器

1)l.erase(i++); OK

2)l.erase(i);i++; //error, i 不是一个有效的迭代器
posted @ 2009-11-09 02:57  史莱姆  阅读(221)  评论(0编辑  收藏  举报