深度探索C++14
鏈接:https://pan.baidu.com/s/1zNqUhm5VmrfdEIOyk0XBEg?pwd=eo3t?
提取碼:eo3t

如今科學(xué)工程項(xiàng)目越來越大、越來越復(fù)雜,許多項(xiàng)目都采用C++來完成。同時(shí),隨著嵌入式硬件的日益強(qiáng)大,嵌入式軟件編程語言也轉(zhuǎn)向C++。從嵌入式硬件到高級(jí)編程抽象,C++幾乎支持每個(gè)層級(jí)的編程??偠灾?,C++是一門每一個(gè)技術(shù)人員都需要了解的語言。
本書深入介紹了基于C++高級(jí)功能的復(fù)雜方法。作者選用了多個(gè)不同領(lǐng)域的案例,同時(shí)結(jié)合了向物理學(xué)、數(shù)學(xué)和工程學(xué)等專業(yè)學(xué)生教授C++的豐富經(jīng)驗(yàn),來介紹C++中的關(guān)鍵概念。
本書旨在幫助你快速入門,也會(huì)讓你掌握從lambda表達(dá)式到模板表達(dá)式的諸多高階功能。 你還將學(xué)習(xí)如何使用C++強(qiáng)大的程序庫:標(biāo)準(zhǔn)模板庫(STL)和用于算法、線性代數(shù)、微分方程、圖形的科學(xué)類庫。
作者演示了如何使用面向?qū)ο?、泛型、元編程和過程式編程來編寫清晰明了、直觀練達(dá)的軟件。當(dāng)你學(xué)完本書,你將掌握如何使用C++來編寫高質(zhì)量、高性能的軟件。
內(nèi)容簡介
本書從傳統(tǒng)的Hello World開始,先介紹了語言入門C++所必須的基本要素(如表達(dá)式、語句、聲明);再到和程序組織有關(guān)的函數(shù)、類;然后深入探討了C++所支持的泛型編程、元編程和面向?qū)ο蟮炔煌幊谭妒剑⑶姨峁┝撕芏嗟睦涌梢宰屪x者仔細(xì)體會(huì)它們之間的聯(lián)系、區(qū)別和適用場景;最后再以一個(gè)中型項(xiàng)目為例介紹了一些大型工程所必備的基礎(chǔ)知識(shí)。本書適合C++初學(xué)者、正在開發(fā)和維護(hù)科學(xué)和工程軟件的軟件工程師,以及希望學(xué)習(xí)和理解現(xiàn)代C++機(jī)制如泛型編程和元編程的讀者。
作者簡介
Peter Gottschling 熱衷于編寫前沿的科學(xué)計(jì)算軟件,他希望他的熱情也能感染讀者。因?yàn)槁殬I(yè)的緣故他編寫了MTL4(矩陣模板庫4),同時(shí)也是Boost Graph Library 的作者之一。他曾在多個(gè)C++ 課程和專業(yè)培訓(xùn)中分享過開發(fā)經(jīng)驗(yàn),并撰寫了本書。
譯者吳野,線上常用ID“空明流轉(zhuǎn)”。畢業(yè)后在數(shù)家IT企業(yè)工作過,擁有數(shù)年軟件開發(fā)和硬件設(shè)計(jì)經(jīng)驗(yàn)。C++為其常用編程語言之一,業(yè)余時(shí)間也會(huì)閱讀一些C++標(biāo)準(zhǔn)和標(biāo)準(zhǔn)提案。
目錄
第1章 C++基礎(chǔ)(C++ Basics) 1
1.1 第一個(gè)程序(Our First Program) 1
1.2 變量(Variables) 4
1.2.1 常量(Constants) 7
1.2.2 字面量(Literals) 7
1.2.3 非窄化的初始化(non-narrowing initialization) 9
1.2.4 作用域(Scopes) 11
1.3 操作符(Operators) 13
1.3.1 算術(shù)操作符(Arithmetic Operators) 14
1.3.2 布爾操作符(Boolean Operators) 17
1.3.3 位操作符(Bitwise Operators) 18
1.3.4 賦值(Assignment) 19
1.3.5 程序流(Program Flow) 19
1.3.6 內(nèi)存處理(Memory Handling) 20
1.3.7 訪問操作符(Access Operators) 21
1.3.8 類型處理(Type Handling) 21
1.3.9 錯(cuò)誤處理(Error Handling) 21
1.3.10 重載(Overloading) 22
1.3.11 操作符優(yōu)先級(jí)(Operator Precedence) 22
1.3.12 避免副作用(Avoid Side Effects?。?22
1.4 表達(dá)式和語句(Expressions and Statements) 25
1.4.1 表達(dá)式(Expressions) 25
1.4.2 語句(Statements) 26
1.4.3 分支(Branching) 27
1.4.4 循環(huán)(Loops) 29
1.4.5 goto 33
1.5 函數(shù)(Functions) 33
1.5.1 參數(shù)(Arguments) 34
1.5.2 返回結(jié)果(Returning Results) 36
1.5.3 內(nèi)聯(lián)(Inlining) 37
1.5.4 重載(Overloading) 38
1.5.5 main函數(shù)(main Function) 40
1.6 錯(cuò)誤處理(Error Handling) 41
1.6.1 斷言(Assertions) 41
1.6.2 異常(Exceptions) 43
1.6.3 靜態(tài)斷言(Static Assertions) 48
1.7 I/O 48
1.7.1 標(biāo)準(zhǔn)輸出(Standard Output) 48
1.7.2 標(biāo)準(zhǔn)輸入(Standard Input) 49
1.7.3 文件的輸入和輸出(Input/Output with Files) 49
1.7.4 泛化的流概念(Generic Stream Concept) 50
1.7.5 格式化(Formatting) 51
1.7.6 處理輸入輸出錯(cuò)誤(Dealing with I/O Errors) 53
1.8 數(shù)組、指針和引用(Arrays, Pointers, and References) 56
1.8.1 數(shù)組(Arrays) 56
1.8.2 指針(Pointers) 58
1.8.3 智能指針(Smart Pointers) 62
1.8.4 引用(References) 65
1.8.5 指針和引用的比較(Comparison between Pointers and References) 66
1.8.6 不要引用過期數(shù)據(jù)(Do Not Refer to Outdated Data!) 67
1.8.7 數(shù)組的容器(Containers for Arrays) 67
1.9 軟件項(xiàng)目結(jié)構(gòu)化(Structuring Software Projects) 70
1.9.1 注釋(Comments) 70
1.9.2 預(yù)編譯指示字(Preprocessor Directives) 71
1.10 練習(xí)(Exercises) 75
1.10.1 年齡(Age) 75
1.10.2 數(shù)組和指針(Arrays and Pointers) 76
1.10.3 讀取一個(gè)矩陣市場文件的頭部(Read the Header of a Matrix
Market File) 76
第2章 類(Classes) 77
2.1 為普遍意義而不是技術(shù)細(xì)節(jié)編程(Program for Universal Meaning Not for
Technical Details) 77
2.2 成員(Members) 79
2.2.1 成員變量(Member Variables) 80
2.2.2 可訪問性(Accessibility) 80
2.2.3 訪問操作符(Access Operators) 83
2.2.4 類的靜態(tài)聲明符(The Static Declarator for Classes) 84
2.2.5 成員函數(shù)(Member Functions) 84
2.3 設(shè)置值:構(gòu)造函數(shù)和賦值(Setting Values: Constructors and Assignments) 85
2.3.1 構(gòu)造函數(shù)(Constructors) 86
2.3.2 賦值(Assignment) 96
2.3.3 初始化器列表(Initializer Lists) 97
2.3.4 一致性初始化(Uniform Initialization) 99
2.3.5 移動(dòng)語義(Move Semantic) 101
2.4 析構(gòu)函數(shù)(Destructors) 105
2.4.1 實(shí)現(xiàn)準(zhǔn)則(Implementation Rules) 105
2.4.2 適當(dāng)處理資源(Dealing with Resources Properly) 106
2.5 自動(dòng)生成方法清單(Method Generation Résumé) 112
2.6 成員變量訪問(Accessing Member Variables) 113
2.6.1 訪問函數(shù)(Access Functions) 113
2.6.2 下標(biāo)操作符(Subscript Operator) 115
2.6.3 常量成員函數(shù)(Constant Member Functions) 116
2.6.4 引用限定的變量(Reference-Qualified Members) 117
2.7 操作符重載的設(shè)計(jì)(Operator Overloading Design) 118
2.7.1 保持一致!(Be Consistent!) 119
2.7.2 注意優(yōu)先級(jí)(Respect the Priority) 120
2.7.3 成員函數(shù)和自由函數(shù)(Member or Free Function) 120
2.8 練習(xí)(Exercises) 123
2.8.1 多項(xiàng)式(Polynomial) 123
2.8.2 移動(dòng)賦值(Move Assignment) 123
2.8.3 初始化器列表(Initializer List) 123
2.8.4 資源管理(Resource Rescue) 124
第3章 泛型編程(Generic Programming) 125
3.1 函數(shù)模板(Function Templates) 125
3.1.1 實(shí)例化(Instantiation) 127
3.1.2 參數(shù)類型的推導(dǎo)(Parameter Type Deduction) 128
3.1.3 在模板中處理錯(cuò)誤(Dealing with Errors in Templates) 132
3.1.4 混合類型(Mixing Types) 133
3.1.5 一致性初始化(Uniform Initialization) 134
3.1.6 自動(dòng)返回值類型(Automatic return Type) 134
3.2 命名空間與函數(shù)查找(Namespaces and Function Lookup) 135
3.2.1 命名空間(Namespaces) 135
3.2.2 參數(shù)相關(guān)查找(Argument-Dependent Lookup) 138
3.2.3 命名空間限定還是ADL(Namespace Qualification or ADL) 142
3.3 類模板(Class Templates) 144
3.3.1 一個(gè)容器的范例(A Container Example) 144
3.3.2 為類和函數(shù)設(shè)計(jì)統(tǒng)一的接口(Designing Uniform Class and
Function Interfaces) 146
3.4 類型推導(dǎo)與定義(Type Deduction and Definition) 153
3.4.1 自動(dòng)變量類型(Automatic Variable Type) 153
3.4.2 表達(dá)式的類型(Type of an Expression) 154
3.4.3 decltype(auto) 155
3.4.4 定義類型(Defining Types) 156
3.5 關(guān)于模板的一點(diǎn)點(diǎn)理論:概念(A Bit of Theory on Templates: Concepts) 158
3.6 模板特化(Template Specialization) 159
3.6.1 為單個(gè)類型特化類(Specializing a Class for One Type) 159
3.6.2 函數(shù)特化和重載(Specializing and Overloading Functions) 162
3.6.3 部分特化(Partial Specialization) 164
3.6.4 函數(shù)的部分特化(Partially Specializing Functions) 165
3.7 模板的非類型參數(shù)(Non-Type Parameters for Templates) 168
3.8 仿函數(shù)(Functors) 170
3.8.1 類似函數(shù)的參數(shù)(Function-like Parameters) 172
3.8.2 組合仿函數(shù)(Composing Functors) 173
3.8.3 遞歸(Recursion) 175
3.8.4 泛型歸納函數(shù)(Generic Reduction) 179
3.9 匿名函數(shù)(Lambda) 180
3.9.1 捕獲(Capture) 181
3.9.2 按值捕獲(Capture by Value) 181
3.9.3 按引用捕獲(Capture by Reference) 182
3.9.4 廣義捕獲(Generalized Capture) 184
3.9.5 泛型匿名函數(shù)(Generic Lambdas) 185
3.10 變參模板(Variadic Templates) 186
3.11 練習(xí)(Exercises) 188
3.11.1 字符串表示(String Representation) 188
3.11.2 元組的字符串表示(String Representation of Tuples) 188
3.11.3 泛型棧(Generic Stack) 188
3.11.4 向量的迭代器(Iterator of a Vector) 189
3.11.5 奇數(shù)迭代器(Odd Iterator) 189
3.11.6 奇數(shù)范圍(Odd Range) 189
3.11.7 bool變量的棧(Stack of bool) 190
3.11.8 自定義大小的棧(Stack with Custom Size) 190
3.11.9 非類型模板參數(shù)的推導(dǎo)(Deducing Non-type Template Arguments) 190
3.11.10 梯形公式(Trapezoid Rule) 190
3.11.11 仿函數(shù)(Functor) 191
3.11.12 匿名函數(shù)(Lambda) 191
3.11.13 實(shí)現(xiàn)make_unique(Implement make_unique) 191
第4章 庫(Libraries) 192
4.1 標(biāo)準(zhǔn)模板庫(Standard Template Library) 193
4.1.1 入門示例(Introductory Example) 193
4.1.2 迭代器(Iterators) 194
4.1.3 容器(Containers) 199
4.1.4 算法(Algorithms) 208
4.1.5 超越迭代器(Beyond Iterators) 215
4.2 數(shù)值(Numerics) 216
4.2.1 復(fù)數(shù)(Complex Numbers) 217
4.2.2 隨機(jī)數(shù)發(fā)生器(Random Number Generators) 220
4.3 元編程(Meta-programming) 230
4.3.1 極限(Limits) 230
4.3.2 類型特征(Type Traits) 232
4.4 支持庫(Utilities) 234
4.4.1 元組(Tuple) 235
4.4.2 函數(shù)(function) 238
4.4.3 引用包裝器(Reference Wrapper) 240
4.5 就是現(xiàn)在(The Time Is Now) 242
4.6 并發(fā)(Concurrency) 244
4.7 標(biāo)準(zhǔn)之外的科學(xué)計(jì)算程序庫(Scientific Libraries Beyond the Standard) 248
4.7.1 其他算術(shù)運(yùn)算庫(Other Arithmetics) 248
4.7.2 區(qū)間算術(shù)(Interval Arithmetic) 248
4.7.3 線性代數(shù)(Linear Algebra) 249
4.7.4 常微分方程(Ordinary Differential Equations) 249
4.7.5 偏微分方程(Partial Differential Equations) 249
4.7.6 圖論算法(Graph Algorithms) 250
4.8 練習(xí)(Exercises) 250
4.8.1 按模排序(Sorting by Magnitude) 250
4.8.2 STL容器(STL Container) 250
4.8.3 復(fù)數(shù)(Complex Numbers) 250
第5章 元編程(Meta-Programming) 252
5.1 讓編譯器進(jìn)行計(jì)算(Let the Compiler Compute) 252
5.1.1 編譯期函數(shù)(Compile-Time Functions) 253
5.1.2 擴(kuò)展的編譯期函數(shù)(Extended Compile-Time Functions) 255
5.1.3 質(zhì)數(shù)(Primeness) 257
5.1.4 此常數(shù)?彼常數(shù)?(How Constant Are Our Constants?) 259
5.2 提供和使用類型信息(Providing and Using Type Information) 260
5.2.1 類型特征(Type Traits) 261
5.2.2 條件異常處理(Conditional Exception Handling) 264
5.2.3 一個(gè)const整潔視圖的用例(A const-Clean View Example) 265
5.2.4 標(biāo)準(zhǔn)類型特征(Standard Type Traits) 272
5.2.5 領(lǐng)域特定的類型屬性(Domain-Specific Type Properties) 272
5.2.6 enable_if 274
5.2.7 新版變參模板(Variadic Templates Revised) 278
5.3 表達(dá)式模板(Expression Templates) 281
5.3.1 一個(gè)簡單的操作符實(shí)現(xiàn)(Simple Operator Implementation) 281
5.3.2 一個(gè)表達(dá)式模板類(An Expression Template Class) 285
5.3.3 泛化的表達(dá)式模板(Generic Expression Templates) 288
5.4 元優(yōu)化:編寫你自己的編譯器優(yōu)化(Meta-Tuning: Write Your Own Compiler Optimization) 290
5.4.1 經(jīng)典的固定大小的循環(huán)展開(Classical Fixed-Size Unrolling) 292
5.4.2 嵌套展開(Nested Unrolling) 295
5.4.3 動(dòng)態(tài)循環(huán)展開――熱身(Dynamic Unrolling―Warm-up) 301
5.4.4 展開向量表達(dá)式(Unrolling Vector Expressions) 303
5.4.5 調(diào)優(yōu)表達(dá)式模板(Tuning an Expression Template) 305
5.4.6 調(diào)優(yōu)縮減運(yùn)算(Tuning Reduction Operations) 308
5.4.7 調(diào)優(yōu)嵌套循環(huán)(Tuning Nested Loops) 316
5.4.8 調(diào)優(yōu)一覽(Tuning Résumé) 322
5.5 練習(xí)(Exercises) 323
5.5.1 類型特征(Type Traits) 323
5.5.2 Fibonacci數(shù)列(Fibonacci Sequence) 323
5.5.3 元編程版的最大公約數(shù)(Meta-Program for Greatest Common Divisor) 323
5.5.4 向量表達(dá)式模板(Vector Expression Template) 324
5.5.5 元列表(Meta-List) 325
第6章 面向?qū)ο缶幊蹋∣bject-Oriented Programming) 326
6.1 基本原則(Basic Principles) 327
6.1.1 基類和派生類(Base and Derived Classes) 327
6.1.2 繼承構(gòu)造(Inheriting Constructors) 331
6.1.3 虛函數(shù)和多態(tài)類(Virtual Functions and Polymorphic Classes) 332
6.1.4 基于繼承的仿函數(shù)(Functors via Inheritance) 338
6.2 消除冗余(Removing Redundancy) 339
6.3 多重繼承(Multiple Inheritance) 340
6.3.1 多個(gè)父類(Multiple Parents) 340
6.3.2 公共祖父(Common Grandparents) 342
6.4 通過子類型進(jìn)行動(dòng)態(tài)選擇(Dynamic Selection by Sub-typing) 347
6.5 轉(zhuǎn)換(Conversion) 350
6.5.1 在基類和派生類之間轉(zhuǎn)換(Casting between Base and Derived Classes) 351
6.5.2 const轉(zhuǎn)換(const-Cast) 356
6.5.3 重解釋轉(zhuǎn)型(Reinterpretation Cast) 356
6.5.4 函數(shù)風(fēng)格的轉(zhuǎn)型(Function-Style Conversion) 357
6.5.5 隱式轉(zhuǎn)換(Implicit Conversions) 359
6.6 CRTP 359
6.6.1 一個(gè)簡單的例子(A Simple Example) 360
6.6.2 一個(gè)可復(fù)用的訪問操作符(A Reusable Access Operator) 361
6.7 練習(xí)(Exercises) 364
6.7.1 無冗余的菱形繼承(Non-redundant Diamond Shape) 364
6.7.2 繼承向量類(Inheritance Vector Class) 364
6.7.3 克隆函數(shù)(Clone Function) 364
第7章 科學(xué)計(jì)算項(xiàng)目(Scientific Projects) 365
7.1 常微分方程解算器的實(shí)現(xiàn)(Implementation of ODE Solvers) 365
7.1.1 常微分方程(Ordinary Differential Equations) 366
7.1.2 龍格-庫塔法(Runge-Kutta Algorithms) 368
7.1.3 泛型實(shí)現(xiàn)(Generic Implementation) 369
7.1.4 展望(Outlook) 376
7.2 創(chuàng)建工程(Creating Projects) 377
7.2.1 構(gòu)建過程(Build Process) 378
7.2.2 構(gòu)建工具(Build Tools) 382
7.2.3 分離編譯(Separate Compilation) 386
7.3 最終的話(Some Final Words) 391
附錄A 雜談(Clumsy Stuff) 393
A.1 更多好的或者不好的軟件(More Good and Bad Scientific Software) 393
A.2 細(xì)節(jié)中的基礎(chǔ)(Basics in Detail) 400
A.2.1 關(guān)于字面量修飾的其他事項(xiàng)(More about Qualifying Literals) 400
A.2.2 靜態(tài)變量(static Variables) 401
A.2.3 關(guān)于if的其他事項(xiàng)(More about if) 402
A.2.4 達(dá)夫設(shè)備(Duff’s Device) 404
A.2.5 關(guān)于main的其他事項(xiàng)(More about main) 404
A.2.6 異常還是斷言?(Assertion or Exception?) 405
A.2.7 二進(jìn)制I/O(Binary I/O) 406
A.2.8 C風(fēng)格的I/O(C-Style I/O) 407
A.2.9 垃圾收集(Garbage Collection) 408
A.2.10 宏的麻煩(Trouble with Macros) 409
A.3 現(xiàn)實(shí)世界的用例:矩陣求逆(Real-World Example: Matrix Inversion) 411
A.4 類的一些細(xì)節(jié)(Class Details) 421
A.4.1 指向成員的指針(Pointer to Member) 421
A.4.2 更多的初始化例子(More Initialization Examples) 422
A.4.3 多維數(shù)組的存?。ˋccessing Multi-dimensional Arrays) 423
A.5 方法的生成(Method Generation) 426
A.5.1 控制生成的代碼(Controlling the Generation) 428
A.5.2 代碼生成的規(guī)則(Generation Rules) 429
A.5.3 陷阱和設(shè)計(jì)指南(Pitfalls and Design Guides) 434
A.6 模板相關(guān)的細(xì)節(jié)(Template Details) 438
A.6.1 統(tǒng)一初始化(Uniform Initialization) 438
A.6.2 哪個(gè)函數(shù)被調(diào)用了?(Which Function Is Called?) 439
A.6.3 針對(duì)特定硬件的特化(Specializing for Specific Hardware) 442
A.6.4 變參二進(jìn)制I/O(Variadic Binary I/O) 443
A.7 使用C++03中的std::vector(Using std::vector in C++03) 444
A.8 復(fù)古風(fēng)格的動(dòng)態(tài)選擇(Dynamic Selection in Old Style) 445
A.9 元編程的一些細(xì)節(jié)(Meta-Programming Details) 446
A.9.1 歷史上的第一個(gè)元程序(First Meta-Program in History) 446
A.9.2 元函數(shù)(Meta-Functions) 448
A.9.3 向下兼容的靜態(tài)斷言(Backward-Compatible Static Assertion) 450
A.9.4 匿名類型參數(shù)(Anonymous Type Parameters) 450
A.9.5 “動(dòng)態(tài)循環(huán)展開”的性能基準(zhǔn)測試源碼(Benchmark Sources of
Dynamic Unrolling) 454
A.9.6 矩陣乘法的性能基準(zhǔn)測試(Benchmark for Matrix Product) 455
附錄B 編程工具(Programming Tools) 456
B.1 gcc 456
B.2 調(diào)試(Debugging) 457
B.2.1 基于文本的調(diào)試器(Text-Based Debugger) 458
B.2.2 使用圖形界面DDD進(jìn)行調(diào)試(Debugging with Graphical Interface: DDD) 460
B.3 內(nèi)存分析(Memory Analysis) 462
B.4 gnuplot 463
B.5 UNIX、Linux和macOS系統(tǒng)(UNIX, Linux, and macOS) 464
附錄C 語言定義(Language Definitions) 467
C.1 值類別(Value Categories) 467
C.2 操作符概覽(Operator Overview) 468
C.3 類型轉(zhuǎn)換規(guī)則(Conversion Rules) 470
C.3.1 類型提升(Promotion) 471
C.3.2 其他類型提升(Other Conversions) 471
C.3.3 常用的數(shù)值轉(zhuǎn)換(Usual Arithmetic Conversions) 472
C.3.4 窄化(Narrowing)
查看全部↓
前言/序言
推薦序1:一些關(guān)于C++的大實(shí)話
我在北美這幾年面試了上百位應(yīng)聘者,這邊的公司大多會(huì)讓應(yīng)聘者自選編程語言。我注意到一個(gè)現(xiàn)象,即使用C++作為面試語言的應(yīng)聘者比例很低,大約不到1/10,在應(yīng)屆生中這個(gè)比例更低,遠(yuǎn)遠(yuǎn)不如我早前在上海和香港那幾年面試的情況。在面試中,我也不再考察C++語法和標(biāo)準(zhǔn)庫的知識(shí)點(diǎn)了。因?yàn)閾?jù)我了解,即便是北美計(jì)算機(jī)科班出身的應(yīng)屆生也不一定在學(xué)校學(xué)過C++,他們學(xué)習(xí)的編程語言一般以Java或Python為主,然后因?yàn)椴僮飨到y(tǒng)或體系結(jié)構(gòu)課程需要,會(huì)學(xué)一點(diǎn)C語言。這些新人參加工作之后,如果項(xiàng)目需要,會(huì)用兩三周的時(shí)間,在原有的編程語言基礎(chǔ)上快速入門C++,然后仿照項(xiàng)目現(xiàn)有代碼的風(fēng)格和習(xí)慣,開始上手C++編程。這種學(xué)習(xí)方式的優(yōu)點(diǎn)是主次分明、重點(diǎn)突出、有的放矢。相比之下,其他專業(yè)的畢業(yè)生掌握C++的比例就更低了,我見過一些統(tǒng)計(jì)或者信號(hào)處理方向的博士們畢業(yè)之后進(jìn)入工業(yè)界,需要把自己原來用R語言或者M(jìn)ATLAB實(shí)現(xiàn)的模型或算法用C++重寫,使之融入公司的產(chǎn)品。正是因?yàn)橛羞@樣的開發(fā)者使用C++來完成工作中的開發(fā)任務(wù),才賦予了這門語言蓬勃的生命力,否則它就只能淪為C++語言愛好者的玩物了。
換句話說,早前我剛參加工作那會(huì)兒的行情是:在學(xué)校學(xué)好C++,借此找到好工作?,F(xiàn)在的情況變成了先學(xué)會(huì)編程,找份好工作,如果工作需要,再去學(xué)C++。本書正是適應(yīng)這種“新需求”的產(chǎn)物,作者Peter Gottschling在科學(xué)計(jì)算領(lǐng)域頗有建樹,也有豐富的教學(xué)經(jīng)驗(yàn),他的書抓住了重點(diǎn),能夠把C++常用功能的使用方法快速傳授給讀者。