Wrox Home  
Search

Topic: C# and C++

Professional C++, 3rd Edition (1118858050) cover image

Professional C++, 3rd Edition

Marc Gregoire
ISBN: 978-1-118-85805-9
Paperback
984 pages
September 2014
View Previous Edition of This Title
Other Available Formats: Wiley E-Text
If you are an instructor, you may request an evaluation copy for this title.
Paperback Version: US $49.99 Add to Cart

About This Title  |  Download Code  |  Errata  |  P2P Forum for This Title

INTRODUCTION xli

Part I: INTRODUCTION TO PROFESSIONAL C++

CHAPTER 1: A CRA SH COURSE IN C++ AND THE STL 3

The Basics of C++ 4

Diving Deeper into C++ 25

C++ as an Object-Oriented Language 34

Summary 46

CHAPTER 2: WORKING WITH STRINGS 47

Dynamic Strings 47

Summary 55

CHAPTER 3: CODING WITH STYLE 57

Naming 68

Formatting 72

Summary 75

Part II: PROFESSIONAL C++ SOFTWAR E DESIGN

CHAPTER 4: DESIGNING PROFESSIONAL C++ PROGRA MS 79

What Is Programming Design? 80

The Importance of Programming Design 80

Designing for C++ 82

Two Rules for C++ Design 83

Reusing Code 87

Deciding Whether or Not to Use the STL 98

Designing with Patterns and Techniques 98

Designing a Chess Program 99

Summary 105

CHAPTER 5: DESIGNING WITH OBJECTS 107

Am I Thinking Procedurally? 108

The Object-Oriented Philosophy 108

Living in a World of Objects 111

Abstraction 122

Summary 126

CHAPTER 6: DESIGNING FOR REUSE 127

The Reuse Philosophy 127

How to Design Reusable Code 128

Summary 140

Part III: CODING THE PROFESSIONAL WAY

CHAPTER 7: GAINING PROFICIENCY WITH CLASSES AND OBJECTS 143

Introducing the Spreadsheet Example 144

Writing Classes 144

Summary 175

CHAPTER 8: MASTERING CLASSES AND OBJECTS 177

Dynamic Memory Allocation in Objects 178

Different Kinds of Data Members 188

More about Methods 193

Nested Classes 199

Enumerated Types Inside Classes 201

Friends 202

Operator Overloading 203

Summary 215

CHAPTER 9: DISCOVERING INHERITANCE TECHNIQUES 217

Building Classes with Inheritance 218

Multiple Inheritance 244

Interesting and Obscure Inheritance Issues 249

Summary 271

CHAPTER 10: C++ QUIRKS, ODDITIES, AND INCIDENTALS 273

References 274

Types and Casts 295

Summary of Casts 301

Scope Resolution 302

C++11 / C++14 303

Header Files 309

C Utilities 310

Summary 313

CHAPTER 11: WRITING GENERIC CODE WITH TEMPLATES 315

Overview of Templates 316

Class Templates 317

Function Templates 339

Variable Templates 343

Summary 343

CHAPTER 12: DEMYSTIFYING C++ I/O 345

Using Streams 346

String Streams 360

File Streams 362

Bidirectional I/O 366

Summary 367

CHAPTER 13: HANDLING ERR ORS 369

Errors and Exceptions 370

Exception Mechanics 372

Exceptions and Polymorphism 387

Stack Unwinding and Cleanup 394

Common Error-Handling Issues 397

Putting It All Together 405

Summary 409

CHAPTER 14: OVERLOADING C++ OPERA TORS 411

Overview of Operator Overloading 412

Overloading the Arithmetic Operators 420

Overloading the Bitwise and Binary Logical Operators 421

Overloading the Insertion and Extraction Operators 422

Overloading the Subscripting Operator 423

Overloading the Function Call Operator 428

Overloading the Dereferencing Operators 429

Writing Conversion Operators 432

Overloading the Memory Allocation and Deallocation Operators 436

Summary 442

CHAPTER 15: OVERVIEW OF THE C++ STANDARD LIBRARY 443

Coding Principles 444

Overview of the C++ Standard Library 445

Summary 465

CHAPTER 16: UNDERSTANDING CONTAINERS AND ITERATORS 467

Containers Overview 468

Sequential Containers 473

Container Adapters 498

Associative Containers 504

Unordered Associative Containers/Hash Tables 516

Other Containers 523

Summary 529

CHAPTER 17: MASTERING STL ALGORITHMS 531

Overview of Algorithms 532

Lambda Expressions 536

Function Objects 542

Algorithm Details 550

Algorithms Example: Auditing Voter Registrations 570

Summary 573

CHAPTER 18: STRING LOCALIZATION AND REGULAR EXPRESSIONS 575

Localization 575

Regular Expressions 581

ECMAScript Syntax 582

Summary 599

CHAPTER 19: ADDITIONAL LIBRARY UTILITIES 601

std::function 601

Ratios 603

The Chrono Library 606

Random Number Generation 612

Tuples 621

Summary 624

Part IV: MASTERING ADVANCED FEATURES OF C++

CHAPTER 20: CUSTOMIZING AND EXTENDING THE STL 627

Allocators 628

Iterator Adapters 628

Extending the STL 634

Summary 671

CHAPTER 21: ADVANCED TEMPLATES 673

More about Template Parameters 673

Class Template Partial Specialization 679

Emulating Function Partial Specialization with Overloading 683

Template Recursion 685

Type Inference 689

Variadic Templates 691

Metaprogramming 695

Summary 705

CHAPTER 22: MEMORY MANAGEMENT 707

Working with Dynamic Memory 708

Array-Pointer Duality 720

Low-Level Memory Operations 722

Smart Pointers 727

Common Memory Pitfalls 734

Summary 740

CHAPTER 23: MULTITHREADED PROGRAMMING WITH C++ 741

Introduction 742

Threads 746

Atomic Operations Library 755

Mutual Exclusion 758

Condition Variables 767

Futures 770

Example: Multithreaded Logger Class 772

Thread Pools 776

Threading Design and Best Practices 777

Summary 778

Part V: C++ SOFTWAR E ENGINEERING

CHAPTER 24: MAXIMIZING SOFTWARE ENGINEERING METHODS 781

The Need for Process 782

Software Life Cycle Models 783

Software Engineering Methodologies 789

Building Your Own Process and Methodology 796

Source Code Control 797

Summary 799

CHAPTER 25: WRITING EFFICIENT C++ 801

Overview of Performance and Efficiency 802

Language-Level Efficiency 803

Design-Level Efficiency 808

Profiling 813

Summary 825

CHAPTER 26: CONQUERING DEBUGGING 827

The Fundamental Law of Debugging 828

Bug Taxonomies 828

Avoiding Bugs 828

Planning for Bugs 829

Debugging Techniques 842

Summary 861

APPENDIX A: C++ INTERVIEWS 863

Chapter 1: A Crash Course in C++ and the STL 863

Chapters 2 and 18: Strings, Localization, and Regular Expressions 864

Chapter 3: Coding with Style 865

Chapter 4: Designing Professional C++ Programs 866

Chapter 5: Designing with Objects 868

Chapter 6: Designing for Reuse 868

Chapters 7 and 8: Classes and Objects 869

Chapter 9: Discovering Inheritance Techniques 872

Chapter 10: C++ Quirks, Oddities, and Incidentals 873

Chapters 11 and 21: Templates 875

Chapter 12: Demystifying C++ I/O 875

Chapter 13: Handling Errors 876

Chapter 14: Overloading C++ Operators 877

Chapters 15, 16, 17, and 20: The Standard Template Library 878

Chapter 19: Additional Library Utilities 878

Chapter 22: Memory Management 879

Chapter 23: Multithreaded Programming with C++ 880

Chapter 24: Maximizing Software Engineering Methods 881

Chapter 25: Writing Efficient C++ 882

Chapter 26: Conquering Debugging 882

APPENDIX B: ANNOTATED BIBLIOGRAPHY 885

C++ 885

C 889

Unified Modeling Language, Uml 889

Algorithms and Data Structures 890

Random Numbers 890

Open-Source Software 890

Software Engineering Methodology 891

Programming Style 892

Computer Architecture 892

Efficiency 893

Testing 893

Debugging 893

Design Patterns 893

Operating Systems 894

Multithreaded Programming 894

APPENDIX C: STANDARD LIBRARY HEADER FILES 895

The C Standard Library 895

Containers 897

Algorithms, Iterators, and Allocators 898

General Utilities 898

Mathematical Utilities 899

Exceptions 899

I/O Streams 900

Threading Library 901

INDEX 903

Printer-Ready Version   Share This
With you wherever you go: pdf + ePub + kindle -- DRM-free