08 2014 档案

摘要:去除尾部多余的字符#include #include int main(int argc, const char *argv[]){ std::string str; char buf[16]; for (int i = 0; i < 10; i++) { int len... 阅读全文
posted @ 2014-08-20 10:12 westfly 阅读(148) 评论(0) 推荐(0)
摘要:这是一篇介绍bind和function用法的文章,起因是近来读陈硕的文章,提到用bind和function替代继承,于是就熟悉了下bind和function的用法,都是一些网上都有的知识,记录一下,期冀对他人也有用处。注:本文暂时不探索bind和function的实现和开销。1. bind 是什么b... 阅读全文
posted @ 2014-08-17 10:57 westfly 阅读(3883) 评论(0) 推荐(2)
摘要:今天开始阅读LevelDB的代码,用source insight建立工程,但其不支持cc后缀的C++文件。找到这篇《source insight看cc文件》解决的根本办法:Options-〉“Document Options”-〉在“File filter” 里边加上*.cc或者 O... 阅读全文
posted @ 2014-08-17 09:09 westfly 阅读(3654) 评论(0) 推荐(1)
摘要:公司每个project代码中,都有一个Config类,作为模块启动的配置。其实现如下struct Config { int num; char * file_name; int load_from_file(const char* filename);}int Config::load_from_f... 阅读全文
posted @ 2014-08-16 15:23 westfly 阅读(1629) 评论(0) 推荐(0)