Thinking in C++ (Second Edition) = C++编程思想 (英文版·第2版)PDF电子书下载
- 电子书积分:22 积分如何计算积分?
- 作 者:Bruce Eckel ; Chuck Allison
- 出 版 社:China Machine Press
- 出版年份:2002
- ISBN:7111091622
- 页数:812 页
Introduction 1
Goals 1
Chapters 2
Exercises 5
Exercise solutions 5
Source code 5
Compilers 7
Language standards 9
Seminars,CD-ROMs& consulting 9
Errors 10
About the cover 10
Acknowledgements 10
Ⅰ:Building Stable Systems 13
1:Exception Handling 15
Traditional error handling 16
Throwing an exception 18
Catching an exception 20
The try block 20
Exception handlers 20
Termination and resumption 22
Exception matching 23
Catching any exception 25
Rethrowing an exception 26
Uncaught exceptions 26
Cleaning up 28
Resource management 30
Making everything an object 32
auto_ptr 35
Function-level try blocks 36
Standard exceptions 38
Exception specifications 40
Better exception specifications? 45
Exception specifications and inheritance 46
When not to use exception specifications 47
Exception safety 48
Programming with exceptions 52
When to avoid exceptions 52
Typical uses of exceptions 54
Overhead 58
Summary 60
Exercises 61
2:Defensive Programming 63
Assertions 66
A simple unit test framework 70
Automated testing 71
The TestSuite Framework 75
Test suites 79
The test framework code 81
Debugging techniques 87
Trace macros 87
Trace file 88
Finding memory leaks 90
Summary 96
Exercises 97
Ⅱ:The Standard C++ Library 101
3:Strings in Depth 103
What’s in a string? 104
Creating and initializing C++ strings 106
Operating on strings 109
Appending,inserting,and concatenating strings 110
Replacing string characters 112
Concatenation using nonmember overloaded operators 117
Searching in strings 117
Finding in reverse 123
Finding first/last of a set of characters 124
Removing characters from strings 126
Comparing strings 129
Strings and character traits 134
A string application 140
Summary 145
Exercises 146
4:Iostreams 151
Why iostreams? 151
Iostreams to the rescue 156
Inserters and extractors 156
Common usage 161
Line-oriented input 164
Handling stream errors 165
File iostreams 168
A File-Processing Example 169
Open modes 171
Iostream buffering 173
Seeking in iostreams 175
String iostreams 179
Input string streams 180
Output string streams 182
Output stream formatting 186
Format flags 186
Format fields 188
Width,fill,and precision 190
An exhaustive example 191
Manipulators 194
Manipulators with arguments 196
Creating manipulators 199
Effectors 201
Iostream examples 203
Maintaining class librarysource code 204
Detecting compiler errors 208
A simple data logger 211
Internationalization 216
Wide Streams 216
Locales 218
Summary 221
Exercises 222
5:Templates in Depth 227
Template parameters 227
Non-type template parameters 228
Default template arguments 230
Template template parameters 232
The typename keyword 238
Using the template keyword as a hint 240
Member Templates 242
Function template issues 245
Type deduction of function template arguments 245
Function template overloading 249
Taking the address of a generated function template 251
Applying a function to an STL sequence 255
Partial ordering of function templates 259
Template specialization 260
Explicit specialization 261
Partial Specialization 263
A practical example 265
Preventing template code bloat 268
Name lookup issues 273
Names in templates 273
Templates and friends 279
Template programming idioms 285
Traits 285
Policies 291
The curiously recurring template pattern 294
Template metaprogramming 297
Compile-time programming 298
Expression templates 308
Template compilation models 315
The inclusion model 315
Explicit instantiation 316
The separation model 319
Summary 320
Exercises 321
6:Generic Algorithms 325
A first look 325
Predicates 329
Stream iterators 331
Algorithm complexity 333
Function objects 335
Classification of function objects 336
Automatic creation of function objects 338
Adaptable function objects 341
More function object examples 343
Function pointer adaptors 351
Writing your own function object adaptors 358
A catalog of STL algorithms 362
Support tools for example creation 365
Filling and generating 368
Counting 370
Manipulating sequences 372
Searching and replacing 377
Comparing ranges 385
Removing elements 389
Sorting and operations on sorted ranges 393
Heap operations 403
Applying an operation to each element in a range 405
Numeric algorithms 413
General utilities 417
Creating your own STL-style algorithms 419
Summary 420
Exercises 421
7:Generic Containers 429
Containers and iterators 429
STL reference documentation 431
A first look 432
Containers of strings 438
Inheriting from STL containers 440
A plethora of iterators 442
Iterators in reversible containers 445
Iterator categories 446
Predefined iterators 448
The basic sequences:vector,list,deque 454
Basic sequence operations 454
vector 457
deque 465
Converting between sequences 467
Checked random-access 470
list 471
Swapping sequences 477
set 479
A completely reusable tokenizer 482
stack 487
queue 491
Priority queues 496
Holding bits 506
bitset〈n〉 507
vector〈bool〉 511
Associative containers 513
Generators and fillers for associative containers 518
The magic of maps 521
Multimaps and duplicate keys 523
Multisets 527
Combining STL containers 530
Cleaning up containers of pointers 534
Creating your own containers 536
STL extensions 538
Non-STL containers 540
Summary 546
Exercises 546
Ⅲ:Special Topics 549
8:Runtime Type Identification 551
Runtime casts 551
The typeid operator 557
Casting to intermediate levels 560
void pointers 561
Using RTTI with templates 562
Multiple inheritance 563
Sensible uses for RTTI 564
A trash recycler 565
Mechanism and overhead of RTTI 570
Summary 570
Exercises 571
9:Multiple Inheritance 573
Perspective 573
Interface inheritance 575
Implementation inheritance 579
Duplicate subobjects 585
Virtual base classes 589
Name lookup issues 599
Avoiding MI 603
Extending an interface 603
Summary 608
Exercises 609
10:Design Patterns 613
The pattern concept 613
Prefer composition to inheritance 615
Classifying patterns 615
Features,idioms,patterns 616
Simplifying Idioms 617
Messenger 617
Collecting Parameter 618
Singleton 619
Variations on Singleton 621
Command:choosing the operation 626
Decoupling event handling with Command 628
Object decoupling 631
Proxy:fronting for another object 632
State:changing object behavior 634
Adapter 636
Template Method 639
Strategy:choosing the algorithm at runtime 640
Chain of Responsibility:trying a sequence of strategies 642
Factories:encapsulating object creation 645
Polymorphic factories 647
Abstract factories 651
Virtual constructors 654
Builder:creating complex objects 660
Observer 667
The “inner class” idiom 671
The observer example 674
Multiple dispatching 679
Multiple dispatching with Visitor 683
Summary 687
Exercises 688
11:Concurrency 691
Motivation 692
Concurrency in C++ 694
Installing ZThreads 695
Defining Tasks 696
Using Threads 698
Creating responsive user interfaces 700
Simplifying with Executors 702
Yielding 706
Sleeping 707
Priority 709
Sharing limited resources 711
Ensuring the existence of objects 711
Improperly accessing resources 715
Controlling access 719
Simplified coding with Guards 721
Thread local storage 724
Terminating tasks 727
Preventing iostream collision 727
The ornamental garden 728
Terminating when blocked 733
Interruption 735
Cooperation between threads 741
Wait and signal 742
Producer-consumer relationships 747
Solving threading problems with queues 750
Broadcast 757
Deadlock 764
Summary 770
Exercises 773
A:Recommended Readin 777
General C++ 777
Bruce’s books 777
Chuck’s books 779
In-depth C++ 779
Design Patterns 781
B:Etc 783
Index 791
- 《卓有成效的管理者 中英文双语版》(美)彼得·德鲁克许是祥译;那国毅审校 2019
- 《程序逻辑及C语言编程》卢卫中,杨丽芳主编 2019
- 《先秦政治思想史》梁启超著 2019
- 《《鬼谷子》思想新解 上》林仁政著 2015
- 《刘泽华全集 先秦政治思想史 下》刘泽华著;南开大学历史学院编 2019
- 《AutoCAD 2018自学视频教程 标准版 中文版》CAD/CAM/CAE技术联盟 2019
- 《龙影 西方世界中国观念的思想渊源 增补版》何辉著 2019
- 《跟孩子一起看图学英文》张紫颖著 2019
- 《AutoCAD机械设计实例精解 2019中文版》北京兆迪科技有限公司编著 2019
- 《批判 建构与实践 戴维·佩珀生态社会主义思想研究》梅丽著 2019
- 《少数民族作家海外推广系列 祭语风中》Bruce Humes,范伟责任编辑;(美)Joshua Dyer译;(中国)次仁罗布 2019
- 《量子力学=Quantum Mechanics(Jones & Bartlett):英文》(美)B.C.里德(Bruce Cameron Reed)著 2018
- 《重建 重塑婚姻与自我的愿景》布鲁斯·费雪(BRUCE FISHER)博士,罗伯·艾伯提(ROBERT E .ALBERTI)博士合著;张美惠译 2003
- 《大学英语ESP快速阅读教程 中级》贾爱武总主编;张艺宁主编;(美)CHUCK WHEELER审订;丁仁仑,郭虹宇,江丹邓编委 2012
- 《高速信令 抖动建模、分析与预算》(美)KyungSuk(Dan)Oh,(美)Xingchao(Chuck)Yuan主编;李玉山等译 2014
- 《科学学习心理学》Shawn M. Glynn,Russell H. Yeany,Bruce K. Britton著;熊召弟等译 1996
- 《泌乳》(美)B.L.拉森(Bruce L. Larson)主编;王秋芬等译 1992
- 《当代澳大利亚中短篇小说选》朱炯强,(澳)帕斯科(Pascoe,Bruce)主编 1992
- 《PowerBuilder 应用程序开发指南》(美)Kent marsh,(美)Bruce Braunstein著;廖卫东等译 1996
- 《实用林木改良》(美)佐贝尔(Zobel,Bruce J.)等著;王章荣等译 1990
- 《R语言机器学习 原书第2版=MACHINE LEARNING USING R WITH TIME SERIES AND INDUSTRY-BASED USE CASES IN R》SECOND EDITION
- 《机器学习实战 基于SOPHON平台的机器学习理论与实践=MACHINE LEARNING IN ACTION PRINCIPLES AND PRACTICE BASED ON TH》星环科技人工智能平台团队编著 2020
- 《竞争战略 全译珍藏版》(美)迈克尔·波特(Michael E. Porter)著 2012
- 《网络互联技术手册 第2版》(美)(K.唐斯)Kevin Downes等著;包晓露等译 1999
- 《新版交换式以太网和快速型以太网 第2版》(美)(R.布雷耶)Robert Breyer,(美)(S.赖利)Sean Riley著;肖文贵等译 1997
- 《摄影100关键词》(英)克拉克著 2011
- 《数控技术专业英语》高成秀主编 2010
- 《守望百年 中英文对照爱情长诗》蔡丽双著;张智中译 2014
- 《环境政策概要》(英)卡罗琳·斯奈尔(Carolyn Snell)著;宋伟译 2017
- 《驼铃 中-英-波兰文对照诗集》蔡丽双著;张智中,(波兰)博古米娜·雅尼卡译 2015