2014年9月28日
摘要: 注意几点:分配内存不要使用new和delete,因为new的同时就把对象构造了,而我们需要的是原始内存。所以应该使用标准库提供的allocator类来实现内存的控制。当然也可以重载operator new操作符,因为二者都是使用malloc作为底层实现,所以直接采用malloc也可以。对象的复制必须... 阅读全文
posted @ 2014-09-28 21:03 inevermore 阅读(795) 评论(0) 推荐(4) 编辑
摘要: 代码如下: template void reverse(It begin, It end) { while(begin != end) { --end; if(begin != end) std::swap(*begin++, *end); } } 注意几点: 1.不能一开始... 阅读全文
posted @ 2014-09-28 19:13 inevermore 阅读(451) 评论(1) 推荐(0) 编辑
  2014年9月26日
摘要: 使用Windows live Writer编写博客 测试代码 /** * 从一段文本中检索出唯一的结果 * @param regx 正则表达式语句 * @param text 要检索的文本 * @return */ public String regx(String regx,String text) ... 阅读全文
posted @ 2014-09-26 23:46 inevermore 阅读(158) 评论(0) 推荐(0) 编辑