Professional C++, Second Edition

Book description

Essential reading for experienced developers who are determined to master the latest release of C++

Although C++ is often the language of choice from game programming to major commercial software applications, it is also one of the most difficult to master. With this no-nonsense book, you will learn to conquer the latest release of C++. The author deciphers little-known features of C++, shares detailed code examples that you can then plug into your own code, and reveals the significant changes to C++ that accompany the latest release. You'll discover how to design and build applications that solve real-world problems and then implement the solution using the full capabilities of the language.

Appeals to experienced developers who are looking for a higher level of learning

  • Drills down the extensive changes to the latest C++ standard, C++11, including enhancements made to run-time performance, standard library, language usability, and core language

  • Zeroes in on explaining the more poorly understood elements of the C++ feature set and addresses common pitfalls to avoid

  • Includes case studies that feature extensive, working code that has been tested on Windows and Linux platforms

  • Intertwines text with useful tips, tricks, and workarounds

Packed with best practices for programming, testing, and debugging applications, this book is vital for taking your C++ skills to the next level.

Table of contents

  1. Cover
  2. Contents
  3. Introduction
  4. Part I: Introduction to Professional C++
    1. Chapter 1: A Crash Course in C++
      1. The Basics of C++
      2. Diving Deeper into C++
      3. C++ as an Object-Oriented Language
      4. The Standard Library
      5. Your First Useful C++ Program
      6. Summary
    2. Chapter 2: Designing Professional C++ Programs
      1. What Is Programming Design?
      2. The Importance of Programming Design
      3. What’s Different about C++ Design?
      4. Two Rules for C++ Design
      5. Reusing Code
      6. Designing with Patterns and Techniques
      7. Designing a Chess Program
      8. Summary
    3. Chapter 3: Designing with Objects
      1. Am I Thinking Procedurally?
      2. The Object-Oriented Philosophy
      3. Living in a World of Objects
      4. Object Relationships
      5. Abstraction
      6. Summary
    4. Chapter 4: Designing for Reuse
      1. The Reuse Philosophy
      2. How to Design Reusable Code
      3. Summary
    5. Chapter 5: Coding with Style
      1. The Importance of Looking Good
      2. Documenting Your Code
      3. Decomposition
      4. Naming
      5. Using Language Features with Style
      6. Formatting
      7. Stylistic Challenges
      8. Summary
  5. Part II: C++ Coding the Professional Way
    1. Chapter 6: Gaining Proficiency With Classes and Objects
      1. Introducing the Spreadsheet Example
      2. Writing Classes
      3. Object Life Cycles
      4. Summary
    2. Chapter 7: Mastering Classes and Objects
      1. Dynamic Memory Allocation in Objects
      2. Different Kinds of Data Members
      3. More about Methods
      4. Nested Classes
      5. Enumerated Types Inside Classes
      6. Friends
      7. Operator Overloading
      8. Building Stable Interfaces
      9. Summary
    3. Chapter 8: Discovering Inheritance Techniques
      1. Building Classes with Inheritance
      2. Inheritance for Reuse
      3. Respect Your Parents
      4. Inheritance for Polymorphism
      5. Multiple Inheritance
      6. Interesting and Obscure Inheritance Issues
      7. Summary
    4. Chapter 9: Understanding C++ Quirks and Oddities
      1. References
      2. Keyword Confusion
      3. Types and Casts
      4. Scope Resolution
      5. C++11
      6. Header Files
      7. C Utilities
      8. Summary
    5. Chapter 10: Handling Errors
      1. Errors and Exceptions
      2. Exception Mechanics
      3. Exceptions and Polymorphism
      4. Stack Unwinding and Cleanup
      5. Common Error-Handling Issues
      6. Putting It All Together
      7. Summary
    6. Chapter 11: Delving into the Standard Library
      1. Coding Principles
      2. Overview of the C++ Standard Library
      3. Summary
    7. Chapter 12: Understanding Containers and Iterators
      1. Containers Overview
      2. Sequential Containers
      3. Container Adapters
      4. Associative Containers
      5. Unordered Associative Containers/Hash Tables
      6. Other Containers
      7. Summary
    8. Chapter 13: Mastering STL Algorithms
      1. Overview of Algorithms
      2. Lambda Expressions
      3. Function Objects
      4. Algorithm Details
      5. Algorithms Example: Auditing Voter Registrations
      6. Summary
    9. Chapter 14: Using Strings and Regular Expressions
      1. Dynamic Strings
      2. Localization
      3. Regular Expressions
      4. Summary
    10. Chapter 15: Demystifying C++ I/O
      1. Using Streams
      2. String Streams
      3. File Streams
      4. Bidirectional I/O
      5. Summary
    11. Chapter 16: Additional Library Utilities
      1. std::function
      2. Ratios
      3. The Chrono Library
      4. Random Number Generation
      5. Tuples
      6. Summary
    12. Chapter 17: Customizing and Extending the STL
      1. Allocators
      2. Iterator Adapters
      3. Extending the STL
      4. Summary
  6. Part III: Mastering Advanced Features of C++
    1. Chapter 18: Overloading C++ Operators
      1. Overview of Operator Overloading
      2. Overloading the Arithmetic Operators
      3. Overloading the Bitwise and Binary Logical Operators
      4. Overloading the Insertion and Extraction Operators
      5. Overloading the Subscripting Operator
      6. Overloading the Function Call Operator
      7. Overloading the Dereferencing Operators
      8. Writing Conversion Operators
      9. Overloading the Memory Allocation and Deallocation Operators
      10. Summary
    2. Chapter 19: Writing Generic Code with Templates
      1. Overview of Templates
      2. Class Templates
      3. Function Templates
      4. Summary
    3. Chapter 20: Advanced Templates
      1. More about Template Parameters
      2. Template Class Partial Specialization
      3. Emulating Function Partial Specialization with Overloading
      4. Template Recursion
      5. Type Inference
      6. Variadic Templates
      7. Metaprogramming
      8. Summary
    4. Chapter 21: Effective Memory Management
      1. Working with Dynamic Memory
      2. Array-Pointer Duality
      3. Low-Level Memory Operations
      4. Smart Pointers
      5. Common Memory Pitfalls
      6. Summary
    5. Chapter 22: Multithreaded Programming with C++
      1. Introduction
      2. Atomic Operations Library
      3. Threads
      4. Mutual Exclusion
      5. Condition Variables
      6. Futures
      7. Example: Multithreaded Logger Class
      8. Thread Pools
      9. Threading Design and Best Practices
      10. Summary
  7. Part IV: C++ Software Engineering
    1. Chapter 23: Maximizing Software Engineering Methods
      1. The Need for Process
      2. Software Life Cycle Models
      3. Software Engineering Methodologies
      4. Building Your Own Process and Methodology
      5. Source Code Control
      6. Summary
    2. Chapter 24: Writing Efficient C++
      1. Overview of Performance and Efficiency
      2. Language-Level Efficiency
      3. Design-Level Efficiency
      4. Profiling
      5. Summary
    3. Chapter 25: Developing Cross-Platform and Cross-Language Applications
      1. Cross-Platform Development
      2. Cross-Language Development
      3. Summary
    4. Chapter 26: Becoming Adept at Testing
      1. Quality Control
      2. Unit Testing
      3. Higher-Level Testing
      4. Tips for Successful Testing
      5. Summary
    5. Chapter 27: Conquering Debugging
      1. The Fundamental Law of Debugging
      2. Bug Taxonomies
      3. Avoiding Bugs
      4. Planning for Bugs
      5. Debugging Techniques
      6. Summary
    6. Chapter 28: Incorporating Design Techniques and Frameworks
      1. “I Can Never Remember How to . . .”
      2. There Must Be a Better Way
      3. Object-Oriented Frameworks
      4. Summary
    7. Chapter 29: Applying Design Patterns
      1. The Iterator Pattern
      2. The Singleton Pattern
      3. The Factory Pattern
      4. The Proxy Pattern
      5. The Adapter Pattern
      6. The Decorator Pattern
      7. The Chain of Responsibility Pattern
      8. The Observer Pattern
      9. Summary
  8. Appendix A: C++ Interviews
  9. Appendix B: Annotated Bibliography
  10. Appendix C: Standard Library Header Files

Product information

  • Title: Professional C++, Second Edition
  • Author(s):
  • Release date: October 2011
  • Publisher(s): Wrox
  • ISBN: 9780470932445