Skip to content

Imperfect C++ Practical Solutions for Real-Life Programming

Best in textbook rentals since 2012!

ISBN-10: 0321228774

ISBN-13: 9780321228772

Edition: 2005

Authors: Matthew Wilson

List price: $54.99
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Revealing the pitfalls that are inherent in C++, this guide demonstrates the techniques that can be used to produce code that is more efficient, robust and flexible.
Customers also bought

Book details

List price: $54.99
Copyright year: 2005
Publisher: Addison Wesley Professional
Publication date: 10/21/2004
Binding: Paperback
Pages: 624
Size: 7.25" wide x 9.00" long x 1.25" tall
Weight: 2.090
Language: English

Bob Costanza is a world renowned name in ES. Matthew Wilson, in Costanza's group, is an active ES researcher with major worldwide connections. He is sub-contracted to a six-year research programme on ES in New Zealand by Wratten and Cullen. Wratten is a prolific, internationally-active ecological researcher specialising in biological control and other ecosystem services in agriculture. His sixth book was published in November 2004: Ecological Engineering for Pest Management (with G. Gurr of the University of Sydney and M. Altieri at the University of California, Berkeley). Cullen is an environmental economist working and publishing actively in the evaluation of ES in agriculture and the…    

Preface
Prologue
Imperfections, Constraints, Definitions, and Recommendations
Fundamentals
Enforcing Design: Constraints, Contracts, and Assertions
Eggs and Ham
Compile-Time Contracts: Constraints
Runtime Contracts: Preconditions, Postconditions, and Invariants
Assertions
Object Lifetime
The Object Life Cycle
Controlling Your Clients
MILs and Boon
Resource Encapsulation
A Taxonomy of Resource Encapsulation
POD Types
Wrapper Proxies
RRID Types
RAII Types
RAII Coda
Data Encapsulation and Value Types
A Taxonomy of Data Encapsulation
Value Types and Entity Types
A Taxonomy of Value Types
Open Types
Encapsulated Types
Value Types
Arithmetic Value Types
Value Types Coda
Encapsulation Coda
Object Access Models
Vouched Lifetimes
Copied for Caller
Given to Caller
Shared Objects
Scoping Classes
Value
State
APIs and Services
Language Features
Surviving the Real World
ABI
Sharing Code
C ABI Requirements
C++ ABI Requirements
I Can C Clearly Now
Objects Across Borders
Mostly Portable vtables?
Portable vtables
ABI/OAB Coda
Dynamic Libraries
Calling Functions Explicitly
Indentity: Link Units and Link Space
Lifetime
Versioning
Resource Ownership
Dynamic Libraries: Coda
Threading
Synchronizing Integer Access
Synchronizing Block Access: Critical Regions
Atomic Integer Performance
Multithreading Extensions
Thread Specific Storage
Statics
Nonlocal Static Objects: Globals
Singletons
Function-Local Static Objects
Static Members
Statics Coda
Optimization
Inline Functions
Return Value Optimization
Empty Base Optimization
Empty Derived Optimization
Preventing Optimization
Language Concerns
Fundamental Types
May I Have a byte?
Fixed-Sized Integer Types
Large Integer Types
Dangerous Types
Arrays and Pointers
Don't Repeat Yourself
Arrays Decay into Pointers
dimensionof()
Cannot Pass Arrays to Functions
Arrays Are Always Passed by Address
Arrays of Inherited Types
Cannot Have Multidimensional Arrays
Values
NULL-The Keyword That Wasn't
Down to Zero
Bending the Truth
Literals
Constants
Keywords
interface
temporary
owner
explicit(_cast)
unique
final
Unsupported Keywords
Syntax
Class Layout
Conditional Expressions
for
Variable Notation
Typedefs
Pointer typedefs
What's in a Definition?
Aliases
True Typedefs
The Good, the Bad, and the Ugly
Cognizant Conversions
Casts
Implicit Conversion
Casting in C++
The Case for C Casts
Casts on Steroids
explicit_cast
literal_cast
union_cast
comstl::interface_cast
boost::polymorphic_cast
Casts: Coda
Shims
Embracing Change and Enhancing Flexibility
Attribute Shims
Logical Shims
Control Shims
Conversion Shims
Composite Shim Concepts
Namespaces and Koenig Lookup
Why Not Traits?
Structural Conformance
Breaking Up the Monolith
Shims: Coda
Veneers
Lightweight RAII
Binding Data and Operations
Rubbing Up to Concepts
Veneers: Coda
Bolt-ins
Adding Functionality
Skin Selection
Nonvirtual Overriding
Leveraging Scope
Simulated Compile-Time Polymorphism: Reverse Bolt-ins
Parameterized Polymorphic Packaging
Bolt-ins: Coda
Template Constructors
Hidden Costs
Dangling References
Template Constructor Specialization
Argument Proxies
Argument Targeting
Template Constructors: Coda
Operators
operator bool()
operator int() const
operator void *() const
operator bool() const
operator !()-not!
operator boolean const *() const
operator int boolean::*() const
Operating in the Real World
operator!
Fast, Non-intrusive String Concatenation
fast_string_concatenator<>
Performance
Working with Other String Classes
Concatenation Seeding
Pathological Bracing
Standardization
What's Your Address?
Can't Get the Real Address
What Actions Are Carried Out during Conversion?
What Do We Return?
What's Your Address: Coda
Subscript Operators
Pointer Conversion versus Subscript Operators
Handling Errors
Return Value
Increment Operators
Missing Postfix Operators
Efficiency
Arithmetic Types
Class Definition
Default Construction
Initialization (Value Construction)
Copy Construction
Assignment
Arithmetic Operators
Comparison Operators
Accessing the Value
sinteger64
Truncations, Promotions, and Tests
Arithmetic Types: Coda
Short-circuit!
Extending C++
Return Value Lifetime
A Taxonomy of Return Value Lifetime Gotchas
Why Return-by-Reference?
Solution 1-integer_to_string<>
Solution 2-TSS
Solution 3-Extending RVL
Solution 4-Static Array Size Determination
Solution 5-Conversion Shims
Performance
RVL: The Big Win for Garbage Collection
Potential Applications
Return Value Lifetime: Coda
Memory
A Taxonomy of Memory
The Best of Both Worlds
Allocators
Memory: Coda
Multidimensional Arrays
Facilitating Subscript Syntax
Sized at Run Time
Sized at Compile Time
Block Access
Performance
Multidimensional Arrays: Coda
Functors and Ranges
Syntactic Clutter
for_all()?
Local Functors
Ranges
Functors and Ranges: Coda
Properties
Compiler Extension
Implementation Options
Field Properties
Method Properties
Static Properties
Virtual Properties
Property Uses
Properties: Coda
Compilers and Libraries
Compilers
Libraries
Other Resources
"Watch That Hubris!"
Operator Overload
DRY Rued Yesterday
Paranoid Programming
To Insanity, and Beyond!
Arturius
The CD
Epilogue
Bibliography
Index