摘要: 话说c++11有正则了,在vs2010中有支持,在std里面就有,包含<regex>即可不过感觉没有c#里用的方便,而且没有@关键词写个正则得麻烦死声明正则用regex匹配结果用match_results<T>保存 typedef match_results<const char *> cmatch; typedef match_results<const wchar_t *> wcmatch; typedef match_results<string::const_iterator> smatch; typedef match_re 阅读全文
posted @ 2012-11-09 19:04 mightofcode 阅读(649) 评论(1) 推荐(1) 编辑
摘要: 编程珠玑在11章讲了插入排序和快速排序,稍后的章节还讲了堆排序作者写了多个版本的快速排序,并进行了速度测试,但是最后都干不过stl::sort,stl::sort太给力了让我们来分析一下stl::sort的源码首先说明下测试代码#define ASIZE 10000000 int* buf=new int[ASIZE]; srand(10); for (int i=0;i<ASIZE;i++) { buf[i]=ASIZE-i; buf[i]=0; buf[i]=rand()*rand(); buf[i]=ran... 阅读全文
posted @ 2012-11-09 11:11 mightofcode 阅读(687) 评论(0) 推荐(1) 编辑