C++ Primer - Stanley B. Lippman, Josée Lajoie, Barbara E. Moo

C++ Primer

Stanley B. Lippman, Josée Lajoie, Barbara E. Moo

出版时间

2005-02-14

ISBN

9780201721485

评分

★★★★★
书籍介绍
新的组织结构,更好的帮助循序渐进的全面了解标准C++
AI导读
核心看点
  • 系统讲解C++标准库与核心语法
  • 深入剖析模板、友元等高级特性
  • 兼顾新旧代码兼容与底层机制
适合谁读
  • 希望系统掌握C++的开发者
  • 具备基础编程经验的进阶者
  • 从事底层或高性能开发的人员
读前提醒
  • 内容厚重,建议通读后按需查阅
  • 非零基础小白慎入,难度较高
  • 建议配合习题代码实践以加深理解
读者共识
  • 公认C++学习领域的经典必读之作
  • 虽厚且难,但讲解清晰逻辑严密
  • 适合作为工具书长期翻阅与复习

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "If we have not previously told the compiler that the friend is a template, then the compiler will infer that the friend is an ordinary nontemplate class or function. 如果没有事先告诉编译器该友元是一个模板,则编译器将认为该友元是一个普通非模板类或非模板函数。"
  • "A friend declaration introduces the named class or nonmember function into the surrounding scope. Moreover, a friend function may be defined inside the class. The scope of the function is exported to the scope enclosing the class definition. 友元声明将已命名的类或非成员函数引入到外围作用域中。此外,友元函数可以在类的内部定义,该函数的作用域扩展到包围该类定"
  • "to make a member function a friend, the class containing that member must have been defined. 必须先定义包含成员函数的类,才能将成员函数设为友元。 When we want to restrict friendship to a specific instantiation, then the class or function must have been declared before it can be used in a friend declaration 想要限制对特定实例化的友元关系时,必"
  • "可以将严格弱序看作"小于等于" •两个关键字不能同时"小于等于"对方;如果k1"小于等于"k2, 那么 k2 决不能"小于等于" k1 ."
  • "We can think of a strict weak ordering as “less than” • Two keys cannot both be “less than” each other; if k1 is “less than” k2, then k2 must never be “less than” k1."
  • "Unlike using declarations for ordinary members, a constructor using declaration does not change access level of the inherited constructor(s). More over, a using declaration can't specify explicit or constexpr, the inherited constructor has the same property as the corresponding base constructor."
  • "An inherited constructor is not treated as a user-defined constructor. Therefore, a class that contains only inherited constructors will have a synthesized default constructor."
  • "4.3.2. 新旧代码的兼容 许多 C++ 程序在有标准类之前就已经存在了,因此既没有使用标准库类型 string 也没有使用 vector。而且,许多 C++ 程序为了兼容现存的 C 程序,也 不能使用 C++ 标准库。因此,现代的 C++ 程序经常必须兼容使用数组和/或 C 风格字符串的代码,标准库提供了使兼容界面更容易管理的手段。 194 混合使用标准库类 string 和 C 风格字符串 正如第 3.2.1 节中显示的,可用字符串字面值初始化 string 类对象: string st3("Hello World"); // st3 holds Hello World 通常,由于 C "
Z-Library
收藏