随笔分类 - c++
摘要:1.const修饰函数返回值 (1)指针传递 如果返回const data,non-const pointer,返回值也必须赋给const data,non-const pointer。因为指针指向的数据是常量不能修改。 const int * mallocA(){ ///const data,no
阅读全文
摘要:1. C++ const用法 尽可能使用const 2. C++ const 允许指定一个语义约束,编译器会强制实施这个约束,允许程序员告诉编译器某值是保持不变的。如果在编程中确实有某个值保持不变,就应该明确使用const,这样可以获得编译器的帮助。 3. 3.1.const 修饰成员变量 #inc
阅读全文
摘要:/usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std::_Mem_fn<void 看的上面的错误。 之后Google 了,结合下面两个链接才解决。 https
阅读全文

浙公网安备 33010602011771号