Extended STL shows how to go beyond the C++ standard and extend the Standard Template Library into the wider C++ world of APIs and non-standard collections, to write software that is more efficient, expressive, flexible, and robust.
In Volume 1, innovative techniques help you master STL extension in two important areas: adapting technology-specific libraries and operating system APIs to STL-compliant collections, and defining sophisticated iterator adaptors with which the latent efficiency and expressive power of STL can be realized. Using real-world examples, several powerful concepts and techniques are illustrated, enabling you to extend STL in directions never envisioned by its creators, including collections, element reference categories, external iterator invalidation and inferred interface adaptation.
The focus throughout the book is on helping the reader to write components that are robust, efficient, portable and, importantly, discoverable. The approach is a very practical one, taking readers through the development of real components, highlighting pitfalls and illustrating missteps taken in their development, and providing copious tips on how to avoid them.
Foundations
The Standard Template Library
Extended STL Concepts, or When STL Meets the Real World
Element Reference Categories
The Curious Untemporary Reference
The DRY SPOT Principle
The Law of Leaky Abstractions
Contract Programming
Constraints
Shims
Duck and Goose, or the Whimsical Bases of Partial Structural Conformance
RAII
Template Tools
Inferred Interface Adaptation: Compile-Time Adaptation of Interface-Incomplete Types
Henney’s Hypothesis, or When Templates Attack!
The Independent Autonomies of equal() Friends
Essential Components
Collections
Adapting the glob API
Intermezzo: Constructor Clashes and Design That Is, If Not Bad, At Least Ill-Conceived for Seamless Evolution
Adapting the opendir/readdir API
Adapting the FindFirstFile, FindNextFile API
Intermezzo: When the Efficiency/Usability Balance Is Tipped: Enumerating FTP Server Directories
Enumerating Processes and Modules
The Fibonacci Sequence
Adapting MFC’s CArray Container Family
A Map of the Environment
Traveling Back and Forth on the Z-Plane
String Tokenization
Adapting COM Enumerators
Intermezzo: Correcting Minor Design Omissions with Member Type Inference
Adapting COM Collections
Gathering Scattered I/O
Argument-Dependent Return-Type Variance
External Iterator Invalidation
An Enhanced ostream_iterator
Intermezzo: Proscribing Fatuous Output Iterator Syntax Using the Dereference Proxy Pattern
Transform Iterator
Intermezzo: Discretion Being the Better Part of Nomenclature
Member Selector Iterator
C-Style String Concatenation
String Object Concatenation
Adapted Iterators Traits
Filtered Iteration
Composite Iterator Adaptations
Publisher: Addison-Wesley
Year: 2007
Pages: 572
Language: English
Quality: text source
ISBN: 0-321-30550-7