C++ Primer

Stanley B. Lippman

出版时间

2012-08-06

ISBN

9780321714114

评分

★★★★★
书籍介绍

Bestselling Programming Tutorial and Reference Completely Rewritten for the New C++11 Standard

Now fully updated and recast for the newly released C++11 standard, this authoritative and comprehensive introduction to C++ will help you to learn the language fast, and to use it in modern, highly effective ways. Highlighting today’s best practices, the authors show how to use both the core language and its standard library to write code that is more efficient, readable, and powerful.

C++ Primer, Fifth Edition, introduces the C++ standard library from the outset, drawing on its common functions and facilities to help you write useful programs without first having to master every language detail. Examples take advantage of the library to explain language features and demonstrate how to make the best use of them. A proven tutorial for those new to C++, the authors’ authoritative discussion of core C++ concepts and techniques also make the book a valuable resource for experienced programmers, especially those eager to see C++11 enhancements illuminated.

Start Fast and Achieve More

* Learn how to use the C++11 Standard Library and new language features to quickly build robust programs, and get comfortable with high-level programming

* Learn through examples that illuminate today’s best coding styles and program design techniques

* Understand the “rationale behind the rules”: why C++11 works as it does

* Use the extensive cross-references to help you connect related concepts and insights

* Benefit from up-to-date learning aids and exercises that emphasize key points, help you to avoid pitfalls, promote good practices, and reinforce what you’ve learned

Access the source code for the extended examples as it becomes available at informit.com/title/0321714113.

本书所有作者都是著名的C++权威人物。

Stanley B. Lippman目前是微软公司 Visual C++ 团队的架构师。他从1984年开始在贝尔实验室与C++的设计者Bjarne Stroustrup一起从事C++的设计与开发。他在迪士尼和梦工厂从事动画制作,还担任过JPL的高级顾问。他还著有Inside the C++ Object Model。

Josée Lajoie曾经是IBM加拿大研究中心C/C++编译器开发团队的成员,在ISO C++标准委员会工作了7年,担任过ISO核心语言工作组的主席和C++ Report杂志的专栏作家。

Barbara E. Moo是拥有25年软件经验的独立咨询顾问。在AT&T,她与Stroustrup、Lippman一起管理过复杂的C++开发项目。她和Andrew Koenig合著了Accelerated ...

(展开全部)

AI导读
核心看点
  • 全面重写适配C++11新标准
  • 从标准库视角引入语言特性
  • 涵盖现代C++最佳编程实践
适合谁读
  • C++初学者及进阶开发者
  • 需掌握C++11特性的程序员
  • 追求代码高效与可读性的开发者
读前提醒
  • 篇幅厚重需制定长期阅读计划
  • 结合习题代码深入理解语法细节
  • 重点掌握标准库与核心语言结合
读者共识
  • 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 "
用户评论
const reference, pointer to const, const pointer to nonconst, const pointer to const......
相对第四版与时俱进了好多,尤其在C++11方面。深刻感觉需要再多读几遍。
救我狗命
我觉得 c++ 真的有点过了 所以现在 java 的很多特性都很受欢迎 刚刚好解决问题 刚刚好够用 typescript 和 go 的语言特性设计也或多或少参考了 java scalar在 java 基础上 向更易用 开发效率更高迈进 = =
这次读的纯英文版,读完挺过瘾,算是对整个cpp体系有个比较完整的了解,当然很多细节primer不会涉及。
2023 Aug 12th 第N遍
确实语言清晰
也不能算全都读过了吧,但平时使用时,如果有疑问,能找到对应的地方确认
C++入门的神书。从大一开始就被无数人推荐,然而一直懒于去看,天真地认为学校学的那些C++就够了。后来随着编程学习的继续深入,对C++的敬畏之心渐渐建立起来。原来自己一直用的C++根本就是假的,只是带类的C语言。尤其是学习cs107编程范式的时候,老师也一针见血地指出,大多数C++程序员都是这样的。听到后羞愧难当,把C++从简历里会的语言里都删去了。到了元旦假期,终于有勇气去重新入门C++了。直接上手英文版,以用C++刷LeetCode作为辅助,先看了前3章和9~12章(即基础部分、container 和 smart pointer)。看完之后真的是醍醐灌顶,后悔没有早点“学习”C++。由于本书面面俱到(实在太厚了),我短期内也没有计划全部看完。但是我认为,每读一章,都受益无穷。
收藏