Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions

Foreword

This is a remarkable book, but it wasn't until I had nearly finished reading it that I realized just how remarkable it is. This could well be the first book ever written for people who are already familiar with C++?span class="docEmphasis">all of C++. From language features to components of the standard library to programming techniques, this book skips from topic to topic, always keeping you slightly off balance, always making sure you're paying attention. Just like real C++ programs. Class design bumps into the behavior of virtual functions, iterator conventions run up against name lookup rules, assignment operators sideswipe exception safety, compilation dependencies cross paths with exported templates. Just like they do in real programs. The result is a dizzying maelstrom of language features, library components, and programming techniques at once both chaotic and magnificent. Just like real programs.

I pronounce GotW such that it rhymes with "Gotcha," and perhaps that's fitting. As I compared my solutions to the book's quizzes against Sutter's answers, I fell into the traps he (and C++) laid before me more often than I'd like to admit. I could almost see Herb smiling and softly saying "Gotcha!" for each error I made. Some may argue that this proves I don't know much about C++. Others may claim it demonstrates that C++ is too complex for anyone to master. I believe it shows that when you're working in C++, you have to think carefully about what you're doing. C++ is a powerful language designed to help solve demanding problems, and it's important that you hone your knowledge of the language, its library, and its programming idioms as finely as you can. The breadth of topics in this book will help you do that. So will its unique quiz-based format.

Veteran readers of the C++ newsgroups know how difficult it is to be proclaimed a Guru of the Week. Veteran participants know it even better. On the Internet, of course, there can be only one guru each week, but, backed by the information in this book, you can reasonably hope to produce guru-quality code every time you program.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
exceptional c++47c++工程难题编程问题解决方案(中文版)》讲述如何用标准c++进行企业级的软件开发,通过“问题/解答”的方式,启发读者思考,帮助了解隐藏在问题背后的设计思想,以及各种编程指导原则适用的场合。本书列出的条款涵盖了许多方面的主题,尤其对异常安全性、类和模块的合理设计,正确的代码优化,以及编写符合c++标准的可移植代码进行了深入的讨论。   《exceptional c++47c++工程难题编程问题解决方案(中文版)》适于有一定c++编程基础的读者阅读。 目录 《exceptional c++47c++工程难题编程问题解决方案(中文版)》 1 泛型程序设计与c++标准库 1 条款1:迭代器难度系数 1 条款2:大小写不敏感的字符串——之一 5 条款3:大小写不敏感的字符串——之二 9 条款4:可重用性最高的泛型容器——之一 12 条款5:可重用性最高的泛型容器——之二 13 条款6:临时对象 22 条款7:标准库的使用(或者,再论临时对象) 28 2 异常安全性相关的问题与技术 31 条款8:编写异常安全的代码——之一 32 条款9:编写异常安全的代码——之二 37 条款10:编写异常安全的代码——之三 40 条款11:编写异常安全的代码——之四 47 条款12:编写异常安全的代码——之五 50 条款13:编写异常安全的代码——之六 56 条款14:编写异常安全的代码——之七 62 条款15:编写异常安全的代码——之八 65 条款16:编写异常安全的代码——之九 68 条款17:编写异常安全的代码——之十 73 条款18:代码的复杂性——之一 75 条款19:代码的复杂性——之二 79 3 类的设计与继承 85 条款20:类的编写技巧 85 条款21:虚函数的重载 93 条款22:类之间的关系——之一 99 条款23:类之间的关系——之二 103 条款24:继承的使用和滥用 110 条款25:面向对象程序设计 121 4 编译器防火墙和pimpl惯用法 123 条款26:将编译期依赖性降到最低——之一 123 条款27:将编译期依赖性降到最低——之二 127 条款28:将编译期依赖性降到最低——之三 132 条款29:编译防火墙 135 条款30:fast pimpl惯用法 138 5 名字查找、名字空间和接口规则 148 条款31:名字查找与接口规则——之一 148 条款32:名字查找与接口规则——之二 152 条款33:名字查找和接口规则——之三 162 条款34:名字查找与接口规则——之四 167 6 内存管理 176 条款35:内存管理——之一 176 条款36:内存管理——之二 179 条款37:auto_ptr 186 7 误区、陷阱以及错误的惯用法 201 条款38:对象标识 201 条款39:自动转换 204 条款40:对象的生存期——之一 206 条款41:对象的生存期——之二 209 8 其他主题 219 条款42:变量的初始化 219 条款43:正确使用const 222 条款44:类型转换 231 条款45:bool 238 条款46:转调函数 242 条款47:控制流程 244 后记 254 参考书目 256

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值