《C++编程思想(两卷合订本)》的原文摘录

  • "you shouldn't use a default argument as a flag upon which to conditionallly execute code. you should instead break the function into two or more overloaded functions" (查看原文)
    小顽强 2011-08-01 06:04:20
    —— 引自第348页
  • 在C中,我们常常发现能使程序通过编译,然后我们必须再花力气使它工作。 (查看原文)
    [已注销] 2011-12-16 15:08:10
    —— 引自第114页
  • 与刚才忽略不满足判定函数的元素不同... (查看原文)
    邻家の躺平人 2012-12-21 16:23:43
    —— 引自第199页
  • But, and this is an important point, as soon as you decide to write your own copy-constructor and assignment operator, the compiler assumes that you know what you’re doing and does not automatically call the base-class versions, as it does in the synthesized functions. If you want the base class versions called (and you typically do) then you must explicitly call them yourself. (查看原文)
    [已注销] 2013-05-22 23:19:50
    —— 引自章节:14: Inheritance & Composition
  • $ g++ c12TypeConversation.cpp c12TypeConversation.cpp: 在函数‘int main()’中: c12TypeConversation.cpp:48:20: 错误: 对‘Person::Person(Person)’的调用没有匹配的函数 c12TypeConversation.cpp:48:20: 附注: 备选是: c12TypeConversation.cpp:19:5: 附注: Person::Person(const char*) c12TypeConversation.cpp:19:5: 附注: no known conversion for argument 1 from ‘Person’ to ‘const char*’ c12TypeConversation.cpp:9:5: 附注: Person::Person(Person&) c12TypeConversation.cpp:9:5: 附注: no known conversion for argument 1 from ‘Person’ to ‘Person&’ c12TypeConversation.cpp:39:6: 错误: 初始化‘void whatname(Person)’的实参 1 (查看原文)
    prife 5回复 2014-04-09 19:12:25
    —— 引自第561页
  • construction Jack copy construction Jack Jack free Jack construction MARY MARY free MARY free Jack (查看原文)
    prife 5回复 2014-04-09 19:12:25
    —— 引自第561页
  • 像任何人类语言一样,C++提供了一种表达思想的方法。如果这种表达方法是成功的,那么当问题变得更大和更复杂时,该方法将会明显的表现出比其他方法更容易和更灵活的优点。 (查看原文)
    [已注销] 2021-02-11 10:28:12
    —— 引自章节:前言 5