"C++98 had a single set of rules for type deduction: the one for function templates. C++11 modifies that ruleset a bit and add two more, one for auto and one for decltype. C++14 then extends the usage contexts in which auto and decltype may be employed."
"When users of a complex system are ignorant of how it works, yet happy with what it does, that says a lot about the design of the system. By this measure, template type deduction in C++ is a tremendous success."
"The ability to declare references to arrays enables creation of a template that deduces the number of elements that an array contains."
"The only real difference between auto and template type deduction is that auto assumes that a braced initializer represents a std::initializer_list, but the template type deduction doesn't."
"In C++11, perhaps the primary use for decltype is declaring function templates where the function's return type depends on its parameter types."
"The use of "decltype(auto)" is not limited to function return type. I can also be convenient for declaring variables when you want to apply the decltype type deduction rules to the initializing expression."
"Employing pass-by-value for objects of an unknown type generally risks the performance hit of unnecessary copying, the behavioral problems of object slicing, and ..."
C++ Primer之后的C++书籍。
看了C++ Primer只知道语法,不知道怎么高效使用,甚至也不知道C++语言或者说C++库的各种版本--TR1、Boost,导致没有很好地体现看了C++ Primer的效果。
我记得之前都没听过std::chrono等等。
除了并发API一章几个条款没有认真看--因为对操作系统和C++并发编程心存畏惧,有待进一步学习,其它章节我都认真看了,虽然仍有几章没有看懂,但是收获良多。要在编程中将这些建议付诸行动,也要多翻翻增强记忆。
翻译可以说是不错了,虽然有些地方太过拗口,并且部分地方感觉有些急躁,总体来说读起来还是不错了。
总之看了C++ Primer之后读这本书会很合适。C++并不简单。
看完感觉编译器好累啊!我也好累啊!某人说他不想再做c++的原因就是面试要准备的东西太多太多了……on the other side,这也能占掉不少时间不是吗!随便扯扯淡一个小时就过去了哈哈哈,换成go,我实在不知道能问些啥……高博的翻译口碑一向是很好的,但是这本实在不怎么样,很多不知所云,得看原文才知道啥意思,还有些根本就翻错了