随笔分类 -  STL

摘要:无论何时你建立指针的关联容器,注意你也得指定容器的比较类型。大多数时候,你的比较类型只是解引用指针并比较所指向的对象(就像上面的StringPtrLess做的那样)。鉴于这种情况,你手头最好也能有一个用于那种比较的仿函数模板。像这样 阅读全文
posted @ 2016-12-30 14:40 风的哀伤 阅读(148) 评论(0) 推荐(0)
摘要:map遍历删除 vector遍历删除 阅读全文
posted @ 2016-12-21 15:32 风的哀伤 阅读(383) 评论(0) 推荐(0)
摘要:1 #pragma once 2 #include "stdafx.h" 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 10 bool badvalue(int x) 11 { 12 if (x == 1 || x==2) 13 return tru... 阅读全文
posted @ 2016-12-21 15:28 风的哀伤 阅读(1798) 评论(0) 推荐(0)