
代码积累
Yi白
成长型思维
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数值型字符串转整型代码汇总
摘自 memcache 源码#include <iostream>#include <stdlib.h>#include <string.h>#include <assert.h>using namespace std;/* Avoid warnings on solaris, where isspace() is an index into an array, and gcc uses s原创 2017-02-06 18:20:03 · 560 阅读 · 0 评论 -
跳表实现
参考redis以及http://www.cnblogs.com/liuhao/archive/2012/07/26/2610218.htmlbskl.h#include <vector>using namespace std;class SkipListLevel;static const uint32_t MAX_LEVEL = 8;struct SkipListNode { dou原创 2017-04-25 16:55:09 · 495 阅读 · 0 评论 -
C++ string自定义辅助方法汇总
split方法#include <iostream>#include <vector>#include <sstream>using namespace std;void split(string s, char delim, vector<string>& nodes) { string temp; stringstream ss(s);原创 2017-08-08 13:59:22 · 290 阅读 · 0 评论 -
API之信息隐藏
最近在阅读leveldb的代码,以前没有太关注过信息隐藏,怎样才能不对外暴露实现细节。因此这里以leveldb中的Cache实现为例学习一下^_^// Copyright (c) 2011 The LevelDB Authors. All rights reserved.// Use of this source code is governed by a BSD-style license th原创 2017-08-17 11:32:32 · 390 阅读 · 0 评论