Flylib.com

Books Software

 
 
 

Main Page

I l @ ve RuBoard

   
  Table of Contents
More Exceptional C++
By Herb  Sutter
   
Publisher : Addison Wesley
Pub Date : December 17, 2001
ISBN : 0-201-70434-X
Pages : 304


Organized in a practical problem-and-solution format, More Exceptional C++ picks up where the widely acclaimed Exceptional C++ leaves off, providing successful strategies for solving real-world problems in C++. Drawing from years of in-the-trenches experience, Herb Sutter provides tested techniques and practical solutions for programmers designing modern software systems with C++, from small projects to enterprise applications.

Built around forty programming puzzles, More Exceptional C++ helps you understand the rules and issues critical to successful software design and development in C++. New themes included in this sequel place a strong emphasis on generic programming, memory management, and using the C++ standard library, including coverage of important techniques like traits and predicates. Also included are guidelines and considerations to remember when using standard containers and algorithms--topics rarely covered in-depth in other sources.

Readers will find solutions to such important questions as:

  • What pitfalls might you encounter when using std::map and std::set, and how can you safely avoid them?

  • What kinds of predicates are safe to use with the STL, what kinds aren't, and why?

  • What techniques are available for writing powerful generic template code that can change its own behavior based on the capabilities of the types it's given to work with?

  • When and how should you optimize your code? Why can (and do) fancy optimizations get us into trouble? And how can some of these answers change if you're writing multithread-safe code?

  • Does exception safety affect class design, or can it be retrofitted in as an afterthought?

  • How can you avoid the Siamese Twin problem when combining inheritance-based libraries from different vendors ?

  • How can you safely use auto_ptr, and then use common design patterns to adapt it to avoid common pitfalls? Can you use auto_ptr as a class member? What must you know before you elect to use it that way?

  • Plus one of the most frequently recurring questions about modern C++: When and how should you use namespaces, anyway?

A must-have for the serious programmer, More Exceptional C++ provides a thorough and pragmatic understanding of the language while showing you how to write exceptional code in C++.

I l @ ve RuBoard
I l @ ve RuBoard

   
  Table of Contents
More Exceptional C++
By Herb  Sutter
   
Publisher : Addison Wesley
Pub Date : December 17, 2001
ISBN : 0-201-70434-X
Pages : 304


      Copyright
      Foreword
      Preface
        What's "More?"
        What I Assume You Know
        How to Read This Book
        Namespaces, Typename, References, and Other Conventions
        Acknowledgments
     
      Generic Programming and the C++ Standard Library
        Item  1.   Switching Streams
        Solution
     
        Item  2.   Predicates, Part 1: What remove() Removes
        Solution
     
        Item  3.   Predicates, Part 2: Matters of State
        Solution
     
        Item  4.   Extensible Templates: Via Inheritance or Traits?
        Solution
     
        Item  5.   Typename
        Solution
     
        Item  6.   Containers, Pointers, and Containers That Aren't
        Solution
     
        Item  7.   Using vector and deque
        Solution
     
        Item  8.   Using set and map
        Solution
     
        Item  9.   Equivalent Code?
        Solution
     
        Item  10.   Template Specialization and Overloading
        Solution
     
        Item  11.   Mastermind
        Simplified Rules Summary
        Solution
     
     
      Optimization and Performance
        Item  12.   inline
        Solution
     
        Item  13.   Lazy Optimization, Part 1: A Plain Old String
        Solution
     
        Item  14.   Lazy Optimization, Part 2: Introducing Laziness
        Solution
     
        Item  15.   Lazy Optimization, Part 3: Iterators and References
        Solution
     
        Item  16.   Lazy Optimization, Part 4: Multithreaded Environments
        Solution
     
     
      Exception Safety Issues and Techniques
        Item  17.   Constructor Failures, Part 1: Object Lifetimes
        Solution
     
        Item  18.   Constructor Failures, Part 2: Absorption?
        Solution
     
        Item  19.   Uncaught Exceptions
        Solution
     
        Item  20.   An Unmanaged Pointer Problem, Part 1: Parameter Evaluation
        Solution
     
        Item  21.   An Unmanaged Pointer Problem, Part 2: What About auto_ptr?
        Solution
     
        Item  22.   Exception-Safe Class Design, Part 1: Copy Assignment
        Solution
     
        Item  23.   Exception-Safe Class Design, Part 2: Inheritance
        Solution
     
     
      Inheritance and Polymorphism
        Item  24.   Why Multiple Inheritance?
        Solution
     
        Item  25.   Emulating Multiple Inheritance
        Solution
     
        Item  26.   Multiple Inheritance and the Siamese Twin Problem
        Solution
     
        Item  27.   (Im)pure Virtual Functions
        Solution
     
        Item  28.   Controlled Polymorphism
        Solution
     
     
      Memory and Resource Management
        Item  29.   Using auto_ptr
        Solution
     
        Item  30.   Smart Pointer Members, Part 1: A Problem with auto_ptr
        Solution
     
        Item  31.   Smart Pointer Members, Part 2: Toward a ValuePtr
        Solution
     
     
      Free Functions and Macros
        Item  32.   Recursive Declarations
        Solution
     
        Item  33.   Simulating Nested Functions
        Solution
     
        Item  34.   Preprocessor Macros
        Solution
     
        Item  35.   #Definition
        Solution
     
     
      Miscellaneous Topics
        Item  36.   Initialization
        Solution
     
        Item  37.   Forward Declarations
        Solution
     
        Item  38.   Typedef
        Solution
     
        Item  39.   Namespaces, Part 1: Using-Declarations and Using-Directives
        Solution
     
        Item  40.   Namespaces, Part 2: Migrating to Namespaces
        Solution
     
     
      Afterword
      Appendix A.   Optimizations That Aren't (in a Multithreaded World)
        Introduction
        What's the Fuss About?
        Recap: Plain Old Original:: String (Item 13)
        Using a Plain Old String: Single-Threaded
        Using a Plain Old String: Multithreaded
        Now Throw in an "Optimization": Copy-On-Write (COW)
        Using a COW String: Multithreaded
        Mild versus Severe Inefficiencies
        Some Actual Numbers
        A Real-World Example: C++'s basic_string
        "Am I Affected?"
        Summary
     
      Appendix B.   Test Results for Single-Threaded versus Multithread-Safe String Implementations
        Approach
        Raw Measurements
        Test Harness
     
      Bibliography
I l @ ve RuBoard