随笔分类 -  C++

gtest 的彩色信息输出 + boost.test 的内存泄漏检测及定位
摘要:gtest 的彩色信息输出 + boost.test 的内存泄漏检测及定位 阅读全文
posted @ 2009-06-09 08:44 吴尔平 阅读(3474) 评论(0) 推荐(0) 编辑
在低版本的 vc 中使用 vc 10.0 的新特性
摘要:在低版本的 vc 中使用 vc 10.0 的新特性 阅读全文
posted @ 2009-06-08 08:41 吴尔平 阅读(7423) 评论(3) 推荐(0) 编辑
scons + swig
摘要:scons + swig ( WuErPing 2009/02/10 )scons是个好东西,swig也是个好东西,两个好东西加起来如何 ?本文所用开发环境:swigwin-1.3.38 http://www.swig.org./SCons 1.2.0.d20090113 http://www.scons.org/python 2.6.1 http://www.python.org/lua 5.... 阅读全文
posted @ 2009-02-10 15:47 吴尔平 阅读(1147) 评论(0) 推荐(0) 编辑
vc9 Feature Pack Beta tr1 的一些问题
摘要:最近使用了 vc9 Feature Pack 里 tr1 一些库,但结果却让我比较失望. 一、头文件包含的问题如果你建一个简单的console项目,如下包含1#include<random>2#include<regex>你不会有任何问题,但当你的包含了windows.h时,就会看到output窗口里是无尽的错误与警告。>c:\program files\micros... 阅读全文
posted @ 2008-03-29 09:52 吴尔平 阅读(1761) 评论(0) 推荐(0) 编辑
关于模板化的friend class
摘要:2007-3-17 10:42 By WuErPing 首先,C++标准在这个地方定义得不精确,这就给厂商的实现带来了想象的空间。VC和GCC在这里就有不得不注意的差别代码一、VC的实现(7.1, 8)1#include<iostream>2usingnamespacestd;34#include<iostream>5usingnamespacestd;67templat... 阅读全文
posted @ 2007-03-17 10:34 吴尔平 阅读(1957) 评论(1) 推荐(0) 编辑
如何在 VS2005 的 Team Unit Testing frameworks 中测试 Native Code (C++ )
摘要:开始用C++/CLI做项目,但默认生成的UnitTest在项目中使用了C++代码时会出错。这个问题在困扰了我两天后,终于找到了答案,共享之。 Re: Testing Native Code (C++ ) using Team Unit Testing frameworks http://forums.microsoft.com/MSDN/ShowPost.aspx?PostI... 阅读全文
posted @ 2006-01-03 09:48 吴尔平 阅读(1674) 评论(4) 推荐(0) 编辑
2005 CRT memory leaks
摘要:看了7cat转了个贴子,才发现用VC2005之前有件很重要的事要做,一件非常重要的事情,重要到不做这件事情,你无法使用VC2005。因为: 2005 CRT memory leaks: std::basic_iostream ( affects std::stringstream, std::fstream, probably others )!!! 这真是件让人郁闷的事情!... 阅读全文
posted @ 2006-01-01 21:24 吴尔平 阅读(1741) 评论(0) 推荐(0) 编辑
Boost String Algorithms Library 函数详解四 (Erase/Replace)
摘要:Table 11.5. Erase/Replace Algorithm name Description Functions replace/erase_first Replace/Erase the first occurrence of a string in the input replace_first() replace_first_copy() ireplace_f... 阅读全文
posted @ 2005-12-08 23:53 吴尔平 阅读(1920) 评论(0) 推荐(0) 编辑
Boost String Algorithms Library 函数详解三 (find)
摘要:Table 11.4. Find algorithms Algorithm name Description Functions find_first Find the first occurrence of a string in the input find_first() ifind_first() find_last Find the last occurrenc... 阅读全文
posted @ 2005-11-29 11:00 吴尔平 阅读(2242) 评论(0) 推荐(0) 编辑
Boost String Algorithms Library 函数详解二 (predicate)
摘要:Table 11.3. Predicates Algorithm name Description Functions starts_with Check if a string is a prefix of the other one starts_with()istarts_with() ends_with Check if a string is a suffix ... 阅读全文
posted @ 2005-11-22 23:09 吴尔平 阅读(1682) 评论(0) 推荐(0) 编辑
Boost String Algorithms Library 函数详解一 (case conversion和trimmming)
摘要:Boost String Algorithms Library 是很有用的一个库,它让C++程序员不用一次又一次的为了字符串的处理制造一些小小的轮子。《浅尝boost之String algorithms library》里我主要介绍了它的Split ,因为这个功能很出彩,其它则一带而过。不过,当多次向朋友推荐这个库后,反馈得到的信息让我觉得详细列出其每一个函数的使用,作为一个程序员... 阅读全文
posted @ 2005-11-21 22:56 吴尔平 阅读(1886) 评论(0) 推荐(0) 编辑
Boost.Logging library 评审失败!
摘要:还没到最后日期,作者撑不住了。peer review 果然是恐怖的事情 Hi all, today I got the following message from John Torjo: Due to the feedback I got, I would like you to declare the library as rejected. In the ... 阅读全文
posted @ 2005-11-16 16:38 吴尔平 阅读(1180) 评论(0) 推荐(0) 编辑
Boost.Logging library 评审中
摘要:很早就希望boost中能有一个log库,昨天看到了这个,高兴了一下 ^_^ news://news.gmane.org/gmane.comp.lib.boost.user Subject: [Review] The review of the Boost.Logging library starts November 7th Hi all, today s... 阅读全文
posted @ 2005-11-13 12:17 吴尔平 阅读(3342) 评论(2) 推荐(0) 编辑
boost::timer 的替代方案
摘要:在浅尝boost之timer的post里,我提到boost::timer在linux和windows下的不同表现,并用ACE_OS::gettimeofday做了一个替代方案。不过,为了这个功能把ACE的DLL绑到一起,感觉不是那么愉快。 下面是另一个方案,利用boost::date_time库来解决 #include class ElapsedTime{public: ... 阅读全文
posted @ 2005-09-21 17:53 吴尔平 阅读(1328) 评论(0) 推荐(0) 编辑
浅尝boost.python
摘要:仍只是个坑 阅读全文
posted @ 2005-08-31 23:28 吴尔平 阅读(838) 评论(0) 推荐(0) 编辑
泛C++开发: 如何用C++写跨平台应用
摘要:口号:一次编码,到处编译! :-) 一次编码,在 vc7.1 , vi 甚至ulteredit 上完成编码。 到处编译,将写好的代码 copy 到其它操作系统,也能够编译运行,而不用去修改哪怕一行代码。 听起来是不是象 SUN 的口气,呵呵。 其实 c++ 的移植性个人认为是超过 java 的,java之所以名声在外的原因 B.S 说得很明了:厂商利益。 ... 阅读全文
posted @ 2005-07-29 11:11 吴尔平 阅读(10662) 评论(4) 推荐(0) 编辑
EC3 翻译: 条款55 :熟悉 Boost
摘要:Effective C++ Third Edition 55 Specific Ways to Improve Your Programs and Designs By Scott Meyers Item.55: Familiarize yourself with Boost. 条款55 :熟悉 Boost ... 阅读全文
posted @ 2005-06-20 15:04 吴尔平 阅读(2548) 评论(4) 推荐(0) 编辑
浅尝Boost之Array的初始化
摘要:昨天一个朋友问我,array为什么可以这样写 boost::array a = { 1, 2, 3, 4 }; 答: 重载了赋值操作符,通过类的缺省构造给赋值操作一个右值来初始化一个array变量。 至于为什么要这样做,而不直接初始化?这是为了语法形式上能够与原生数组相符合。我自以为如此就回答了这个问题 。 朋友突然再问了一句,为什么可以这样缺省构... 阅读全文
posted @ 2005-06-06 15:16 吴尔平 阅读(2663) 评论(1) 推荐(0) 编辑
浅尝Boost之Program_options
摘要:最近想找一个跨平台配置文件类。本来ACE下有一个ACE_Configuration_Heap可以用,感觉也不错。不过只是为了读一下配置文件就把整个ACE库链接进来未免有些小题大作,所以重新寻找。boost里有一个Program_options,在Introduction里写的是The program_options library allows program developers to ... 阅读全文
posted @ 2005-05-31 21:35 吴尔平 阅读(3178) 评论(0) 推荐(0) 编辑
浅尝boost之timer
摘要:我一直是在努力推介boost,因为boost是一块美玉,但,没有什么是完美的。现在,我将暴露出boost的一点瑕疵:boost::timer。虽说是瑕不掩瑜,但瑕疵就是瑕疵。先看一看下面的例子: //win2000中vc7.1编译运行 boost::timert; Sleep(1000); cout clock()); } 另一种方案是自己取... 阅读全文
posted @ 2005-04-22 11:33 吴尔平 阅读(2637) 评论(0) 推荐(0) 编辑