2014年1月25日
摘要: vector.erase(it);后,it自动++,一定要弄清楚,删除成功后it指向删除的下一个地址。对于map.erase(it),返回值为NULL,而Vector是返回itorator 阅读全文
posted @ 2014-01-25 17:13 RedLight 阅读(285) 评论(0) 推荐(0) 编辑
摘要: #include#include using namespace std;template class RuntimeCmp{public: enum cmp_mode {normal,reverse};private: cmp_mode m_mode;public: RuntimeCmp(cmp_mode m = normal):m_mode(m){}; bool operator () (const T& t1,const T& t2) { return m_mode == normal ? t1 t2; } bool operat... 阅读全文
posted @ 2014-01-25 15:43 RedLight 阅读(802) 评论(0) 推荐(0) 编辑