Professional C++, 5th Edition

Book description

Improve your existing C++ competencies quickly and efficiently with this advanced volume 

Professional C++, 5th Edition raises the bar for advanced programming manuals. Complete with a comprehensive overview of the new capabilities of C++20, each feature of the newly updated programming language is explained in detail and with examples. Case studies that include extensive, working code round out the already impressive educational material found within. 

Without a doubt, the new 5th Edition of Professional C++ is the leading resource for dedicated and knowledgeable professionals who desire to advance their skills and improve their abilities. This book contains resources to help readers: 

  • Maximize the capabilities of C++ with effective design solutions  
  • Master little-known elements of the language and learn what to avoid  
  • Adopt new workarounds and testing/debugging best practices  
  • Utilize real-world program segments in your own applications 

Notoriously complex and unforgiving, C++ requires its practitioners to remain abreast of the latest developments and advancements. Professional C++, 5th Edition ensures that its readers will do just that. 

Table of contents

  1. COVER
  2. TITLE PAGE
  3. COPYRIGHT
  4. DEDICATION
  5. ABOUT THE AUTHOR
  6. ABOUT THE TECHNICAL EDITORS
  7. ACKNOWLEDGMENTS
  8. INTRODUCTION
    1. WHO THIS BOOK IS FOR
    2. WHAT THIS BOOK COVERS
    3. HOW THIS BOOK IS STRUCTURED
    4. CONVENTIONS
    5. WHAT YOU NEED TO USE THIS BOOK
    6. READER SUPPORT FOR THIS BOOK
  9. PART I: Introduction to Professional C++
    1. 1 A Crash Course in C++ and the Standard Library
      1. C++ CRASH COURSE
      2. YOUR FIRST BIGGER C++ PROGRAM
      3. SUMMARY
      4. EXERCISES
      5. Notes
    2. 2 Working with Strings and String Views
      1. DYNAMIC STRINGS
      2. STRING FORMATTING
      3. SUMMARY
      4. EXERCISES
      5. Notes
    3. 3 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
      9. EXERCISES
      10. Notes
  10. PART II: Professional C++ Software Design
    1. 4 Designing Professional C++ Programs
      1. WHAT IS PROGRAMMING DESIGN?
      2. THE IMPORTANCE OF PROGRAMMING DESIGN
      3. DESIGNING FOR C++
      4. TWO RULES FOR YOUR OWN C++ DESIGNS
      5. REUSING EXISTING CODE
      6. DESIGNING A CHESS PROGRAM
      7. SUMMARY
      8. EXERCISES
    2. 5 Designing with Objects
      1. AM I THINKING PROCEDURALLY?
      2. THE OBJECT-ORIENTED PHILOSOPHY
      3. LIVING IN A WORLD OF CLASSES
      4. CLASS RELATIONSHIPS
      5. SUMMARY
      6. EXERCISES
    3. 6 Designing for Reuse
      1. THE REUSE PHILOSOPHY
      2. HOW TO DESIGN REUSABLE CODE
      3. SUMMARY
      4. EXERCISES
  11. PART III: C++ Coding the Professional Way
    1. 7 Memory Management
      1. WORKING WITH DYNAMIC MEMORY
      2. ARRAY-POINTER DUALITY
      3. LOW-LEVEL MEMORY OPERATIONS
      4. COMMON MEMORY PITFALLS
      5. SMART POINTERS
      6. SUMMARY
      7. EXERCISES
      8. Notes
    2. 8 Gaining Proficiency with Classes and Objects
      1. INTRODUCING THE SPREADSHEET EXAMPLE
      2. WRITING CLASSES
      3. UNDERSTANDING OBJECT LIFE CYCLES
      4. SUMMARY
      5. EXERCISES
      6. Notes
    3. 9 Mastering Classes and Objects
      1. FRIENDS
      2. DYNAMIC MEMORY ALLOCATION IN OBJECTS
      3. MORE ABOUT METHODS
      4. DIFFERENT KINDS OF DATA MEMBERS
      5. NESTED CLASSES
      6. ENUMERATED TYPES INSIDE CLASSES
      7. OPERATOR OVERLOADING
      8. BUILDING STABLE INTERFACES
      9. SUMMARY
      10. EXERCISES
    4. 10 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. CASTS
      8. SUMMARY
      9. EXERCISES
    5. 11 Odds and Ends
      1. MODULES
      2. HEADER FILES
      3. FEATURE TEST MACROS FOR CORE LANGUAGE FEATURES
      4. THE STATIC KEYWORD
      5. C UTILITIES
      6. SUMMARY
      7. EXERCISES
    6. 12 Writing Generic Code with Templates
      1. OVERVIEW OF TEMPLATES
      2. CLASS TEMPLATES
      3. FUNCTION TEMPLATES
      4. VARIABLE TEMPLATES
      5. CONCEPTS
      6. SUMMARY
      7. EXERCISES
    7. 13 Demystifying C++ I/O
      1. USING STREAMS
      2. STRING STREAMS
      3. FILE STREAMS
      4. BIDIRECTIONAL I/O
      5. FILESYSTEM SUPPORT LIBRARY
      6. SUMMARY
      7. EXERCISES
    8. 14 Handling Errors
      1. ERRORS AND EXCEPTIONS
      2. EXCEPTION MECHANICS
      3. EXCEPTIONS AND POLYMORPHISM
      4. RETHROWING EXCEPTIONS
      5. STACK UNWINDING AND CLEANUP
      6. COMMON ERROR-HANDLING ISSUES
      7. SUMMARY
      8. EXERCISES
    9. 15 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. OVERLOADING USER-DEFINED LITERAL OPERATORS
      11. SUMMARY
      12. EXERCISES
    10. 16 Overview of the C++ Standard Library
      1. CODING PRINCIPLES
      2. OVERVIEW OF THE C++ STANDARD LIBRARY
      3. SUMMARY
      4. EXERCISES
    11. 17 Understanding Iterators and the Ranges Library
      1. ITERATORS
      2. STREAM ITERATORS
      3. ITERATOR ADAPTERS
      4. RANGES
      5. SUMMARY
      6. EXERCISES
    12. 18 Standard Library Containers
      1. CONTAINERS OVERVIEW
      2. SEQUENTIAL CONTAINERS
      3. CONTAINER ADAPTERS
      4. ORDERED ASSOCIATIVE CONTAINERS
      5. UNORDERED ASSOCIATIVE CONTAINERS OR HASH TABLES
      6. OTHER CONTAINERS
      7. SUMMARY
      8. EXERCISES
    13. 19 Function Pointers, Function Objects, and Lambda Expressions
      1. FUNCTION POINTERS
      2. POINTERS TO METHODS (AND DATA MEMBERS)
      3. std::function
      4. FUNCTION OBJECTS
      5. LAMBDA EXPRESSIONS
      6. INVOKERS
      7. SUMMARY
      8. EXERCISES
    14. 20 Mastering Standard Library Algorithms
      1. OVERVIEW OF ALGORITHMS
      2. ALGORITHM DETAILS
      3. SUMMARY
      4. EXERCISES
    15. 21 String Localization and Regular Expressions
      1. LOCALIZATION
      2. REGULAR EXPRESSIONS
      3. SUMMARY
      4. EXERCISES
    16. 22 Date and Time Utilities
      1. COMPILE-TIME RATIONAL NUMBERS
      2. DURATION
      3. CLOCK
      4. TIME POINT
      5. DATE
      6. TIME ZONE
      7. SUMMARY
      8. EXERCISES
    17. 23 Random Number Facilities
      1. C-STYLE RANDOM NUMBER GENERATION
      2. RANDOM NUMBER ENGINES
      3. RANDOM NUMBER ENGINE ADAPTERS
      4. PREDEFINED ENGINES AND ENGINE ADAPTERS
      5. GENERATING RANDOM NUMBERS
      6. RANDOM NUMBER DISTRIBUTIONS
      7. SUMMARY
      8. EXERCISES
    18. 24 Additional Library Utilities
      1. VOCABULARY TYPES
      2. TUPLES
      3. SUMMARY
      4. EXERCISES
  12. PART IV: Mastering Advanced Features of C++
    1. 25 Customizing and Extending the Standard Library
      1. ALLOCATORS
      2. EXTENDING THE STANDARD LIBRARY
      3. SUMMARY
      4. EXERCISES
      5. Notes
    2. 26 Advanced Templates
      1. MORE ABOUT TEMPLATE PARAMETERS
      2. CLASS TEMPLATE PARTIAL SPECIALIZATION
      3. EMULATING FUNCTION PARTIAL SPECIALIZATION WITH OVERLOADING
      4. TEMPLATE RECURSION
      5. VARIADIC TEMPLATES
      6. METAPROGRAMMING
      7. SUMMARY
      8. EXERCISES
    3. 27 Multithreaded Programming with C++
      1. INTRODUCTION
      2. THREADS
      3. ATOMIC OPERATIONS LIBRARY
      4. MUTUAL EXCLUSION
      5. CONDITION VARIABLES
      6. LATCHES
      7. BARRIERS
      8. SEMAPHORES
      9. FUTURES
      10. EXAMPLE: MULTITHREADED LOGGER CLASS
      11. THREAD POOLS
      12. COROUTINES
      13. THREADING DESIGN AND BEST PRACTICES
      14. SUMMARY
      15. EXERCISES
  13. PART V: C++ Software Engineering
    1. 28 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
      7. EXERCISES
    2. 29 Writing Efficient C++
      1. OVERVIEW OF PERFORMANCE AND EFFICIENCY
      2. LANGUAGE-LEVEL EFFICIENCY
      3. DESIGN-LEVEL EFFICIENCY
      4. PROFILING
      5. SUMMARY
      6. EXERCISES
    3. 30 Becoming Adept at Testing
      1. QUALITY CONTROL
      2. UNIT TESTING
      3. FUZZ TESTING
      4. HIGHER-LEVEL TESTING
      5. TIPS FOR SUCCESSFUL TESTING
      6. SUMMARY
      7. EXERCISES
    4. 31 Conquering Debugging
      1. THE FUNDAMENTAL LAW OF DEBUGGING
      2. BUG TAXONOMIES
      3. AVOIDING BUGS
      4. PLANNING FOR BUGS
      5. DEBUGGING TECHNIQUES
      6. SUMMARY
      7. EXERCISES
    5. 32 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
      5. EXERCISES
    6. 33 Applying Design Patterns
      1. DEPENDENCY INJECTION
      2. THE ABSTRACT FACTORY PATTERN
      3. THE FACTORY METHOD PATTERN
      4. THE ADAPTER PATTERN
      5. THE PROXY PATTERN
      6. THE ITERATOR PATTERN
      7. THE OBSERVER PATTERN
      8. THE DECORATOR PATTERN
      9. THE CHAIN OF RESPONSIBILITY PATTERN
      10. THE SINGLETON PATTERN
      11. SUMMARY
      12. EXERCISES
    7. 34 Developing Cross-Platform and Cross-Language Applications
      1. CROSS-PLATFORM DEVELOPMENT
      2. CROSS-LANGUAGE DEVELOPMENT
      3. SUMMARY
      4. EXERCISES
  14. PART VI: Appendices
    1. A C++ Interviews
      1. CHAPTER 1: A CRASH COURSE IN C++ AND THE STANDARD LIBRARY
      2. CHAPTERS 2 AND 21: WORKING WITH STRINGS AND STRING VIEWS, STRING LOCALIZATION AND REGULAR EXPRESSIONS
      3. CHAPTER 3: CODING WITH STYLE
      4. CHAPTER 4: DESIGNING PROFESSIONAL C++ PROGRAMS
      5. CHAPTER 5: DESIGNING WITH OBJECTS
      6. CHAPTER 6: DESIGNING FOR REUSE
      7. CHAPTER 7: MEMORY MANAGEMENT
      8. CHAPTERS 8 AND 9: GAINING PROFICIENCY WITH CLASSES AND OBJECTS, AND MASTERING CLASSES AND OBJECTS
      9. CHAPTER 10: DISCOVERING INHERITANCE TECHNIQUES
      10. CHAPTER 11: ODDS AND ENDS
      11. CHAPTERS 12 AND 26: WRITING GENERIC CODE WITH TEMPLATES, AND ADVANCED TEMPLATES
      12. CHAPTER 13: DEMYSTIFYING C++ I/O
      13. CHAPTER 14: HANDLING ERRORS
      14. CHAPTER 15: OVERLOADING C++ OPERATORS
      15. CHAPTERS 16–20 AND 25: THE STANDARD LIBRARY
      16. CHAPTER 22: DATE AND TIME UTILITIES
      17. CHAPTER 23: RANDOM NUMBER FACILITIES
      18. CHAPTER 24: ADDITIONAL LIBRARY UTILITIES
      19. CHAPTER 27: MULTITHREADED PROGRAMMING WITH C++
      20. CHAPTER 28: MAXIMIZING SOFTWARE ENGINEERING METHODS
      21. CHAPTER 29: WRITING EFFICIENT C++
      22. CHAPTER 30: BECOMING ADEPT AT TESTING
      23. CHAPTER 31: CONQUERING DEBUGGING
      24. CHAPTER 32: INCORPORATING DESIGN TECHNIQUES AND FRAMEWORKS
      25. CHAPTER 33: APPLYING DESIGN PATTERNS
      26. CHAPTER 34: DEVELOPING CROSS-PLATFORM AND CROSS-LANGUAGE APPLICATIONS
    2. B Annotated Bibliography
      1. C++
      2. UNIFIED MODELING LANGUAGE
      3. ALGORITHMS AND DATA STRUCTURES
      4. RANDOM NUMBERS
      5. OPEN-SOURCE SOFTWARE
      6. SOFTWARE ENGINEERING METHODOLOGY
      7. PROGRAMMING STYLE
      8. COMPUTER ARCHITECTURE
      9. EFFICIENCY
      10. TESTING
      11. DEBUGGING
      12. DESIGN PATTERNS
      13. OPERATING SYSTEMS
      14. MULTITHREADED PROGRAMMING
    3. C Standard Library Header Files
      1. THE C STANDARD LIBRARY
      2. CONTAINERS
      3. ALGORITHMS, ITERATORS, RANGES, AND ALLOCATORS
      4. GENERAL UTILITIES
      5. MATHEMATICAL UTILITIES
      6. EXCEPTIONS
      7. I/O STREAMS
      8. THREADING SUPPORT LIBRARY
    4. D Introduction to UML
      1. DIAGRAM TYPES
      2. CLASS DIAGRAMS
      3. INTERACTION DIAGRAMS
  15. INDEX
  16. END USER LICENSE AGREEMENT

Product information

  • Title: Professional C++, 5th Edition
  • Author(s): Marc Gregoire
  • Release date: February 2021
  • Publisher(s): Wrox
  • ISBN: 9781119695400