c++
lingqinghua
这个作者很懒,什么都没留下…
展开
-
c++:: when std::stringstream std::cout encouter uint8/sint8
stringstream/cout will take uint8/sint8 as the primitive type: char, so its value will map to ASCII, for example cout stringstream ss; ss cout原创 2011-11-24 14:30:43 · 1025 阅读 · 0 评论 -
boost::shared_ptr Thread Safety
"read" (accessedusing only const operations) simultaneously by multiple threads: OK "written to" (accessed using mutable operations such as operator=or reset) simultaneosly by multiple threads: OK原创 2011-11-29 16:22:36 · 894 阅读 · 0 评论 -
GMock对Mock对象设置期望
GMock对Mock对象设置期望后,并把改对象传给被测代码。 EXPECT_CALL(mock_object, method(matcher1, matcher2, ...)) .With(multi_argument_matcher) .Times(cardinality) .InSequence(sequences)原创 2012-03-30 17:14:56 · 1528 阅读 · 0 评论 -
vim 常用操作
快速跳到最后一行 shift+g 快速跳到指定行 行数+shift+g 显示行数 :set nu 选中连续的多行 起始行行数 shift+g v 结束行行数 shift+g vi 中设置自动缩进 :set autoindent :set ai 取消 :set noautoindent :set noai 大小写转换 normal mode: gU+动原创 2013-02-20 14:05:54 · 589 阅读 · 0 评论 -
C99 高级宏定义
variadic macros 可变参数宏 __VA_ARGS__ 在字符串中还可用 "... #__VA_ARGS__ ..." #define eprintf(...) fprintf (stderr, __VA_ARGS__) #define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__) 其他宏翻译 2013-08-27 11:31:31 · 926 阅读 · 0 评论 -
C++ Knowledge share: 3 kinds of template parameters
Template non-type arguments Such arguments must be constant expressions, addresses of functions or objects with external linkage, or addresses of static class members. Non-type template arguments a翻译 2013-08-09 16:30:31 · 533 阅读 · 0 评论 -
One case to use of the `this` pointer explicitly in template class inherit
template class A { protected: int _m; public: int getM() { return _m; } void setM(int m) { _m = m; } }; template class B: public A { public: int getMM() { re原创 2013-12-11 11:39:43 · 775 阅读 · 0 评论