void test01() { //构造方法 pair p1(10, 2); cout p2 = make_pair(10, "assd"); cout p3 = p2; } ...
分类:
其他好文 时间:
2018-12-26 20:23:16
阅读次数:
140
#include using namespace std; #include void printSet(set s) { for (set::iterator it = s.begin(); it != s.end(); it++) { cout s1;//初始化 s1.insert(1); s1... ...
分类:
其他好文 时间:
2018-12-26 20:15:02
阅读次数:
129
条目八《永不建立auto_ptr的容器》 重要的事说三次,永不建立auto_ptr的容器,永不建立auto_ptr的容器,永不建立auto_ptr的容器!!! 为什么? 实质是 指针在转移时把原本的指针置为NULL,然而在STL容器中的一些操作是包含数据转移操作的。 比如 排序sort() ,在ST ...
分类:
其他好文 时间:
2018-12-26 00:29:50
阅读次数:
125
Duke4005’s performance review on the Air Jordan 33 is here. Grab some popcorn, it’s another great review. If anything in this industry makes me feel o ...
分类:
其他好文 时间:
2018-12-25 21:46:47
阅读次数:
118
STL系列之六 set与hash_set set和hash_set是STL中比较重要的容器,有必要对其进行深入了解。在STL中,set是以红黑树(RB-tree)作为底层数据结构的,hash_set是以Hash table(哈希表)作为底层数据结构的。set可以在时间复杂度为O(logN)情况下插入 ...
分类:
其他好文 时间:
2018-12-25 13:18:07
阅读次数:
141
对象的类型与编码 在 Redis 中新创建一个键值对时, 我们至少会创建两个对象, 一个对象用作键值对的键(键对象), 另一个对象用作键值对的值(值对象)。Redis 中的每个对象都由一个 redisObject 结构表示: 对象类型 对象的type属性记录了对象的类型,type属性的值有以下几种: ...
分类:
其他好文 时间:
2018-12-25 12:27:50
阅读次数:
212
cache cache cache Description 栗酱在上操作系统原理这门课。 她遇到了一个内存管理的置换策略上的问题。 问题可以简化成,有一个单线程程序,有nn步执行,每步执行需要调用第a_iai?个数据。不同的数据的大小相同。根据数据的大小,你被分配了mm页内存,每页内存可以装取一个数 ...
分类:
系统相关 时间:
2018-12-25 11:39:06
阅读次数:
273
1 #include 2 using namespace std; 3 #include 4 5 void printVector(vector& v) { 6 for (vector::iterator it = v.begin(); it != v.end(); it++) { 7 cout v... ...
分类:
其他好文 时间:
2018-12-24 19:45:55
阅读次数:
101
1 #include 2 using namespace std; 3 #include 4 5 6 //初始化操作 7 void test01() { 8 //初始化操作 9 string s1; 10 string s2(10, 'a'); 11 string s3("abc"); 12 str... ...
分类:
其他好文 时间:
2018-12-24 17:19:26
阅读次数:
137
1 #include 2 using namespace std; 3 #include //动态数组 4 #include //算法 5 6 void PrintVector(int v) { 7 cout v; //定义一个容器 指定存放的元素类型 18 v.push_back(10); //把... ...
分类:
其他好文 时间:
2018-12-24 17:16:20
阅读次数:
119