Cart
Free Shipping in the UK
Proud to be B-Corp

Imperfect C++ Matthew Wilson

Imperfect C++ By Matthew Wilson

Imperfect C++ by Matthew Wilson


Condition - Very Good
Out of stock

Summary

Offers practical techniques and tools for writing code that's more robust, flexible, efficient, and maintainable. This book shows you how to tame C++'s complexity, cut through its array of paradigms, take back control over your code - and get far better results. It also helps your compiler detect more errors and work more effectively.

Imperfect C++ Summary

Imperfect C++: Practical Solutions for Real-Life Programming by Matthew Wilson

C++ is one of the most important languages today, but, as with all languages, it is not perfect. Far from it. Hence the topic (and title) of this book: practical techniques for dealing with problems that arise in C++ programming not because the programmer is inexperienced or incompetent, but because this otherwise powerful language is itself deficient in some respect.This book reduces the frustration and indecision programmers experience everyday when using C++. Far from being stymied by a lack of expressiveness in the language, it is commonly the vast array of potential paradigms and techniques supported by C++ that causes the problems. Too many choices.Too much complexity. Where to begin? Where to go? The author, having himself experienced inherent C++ deficiencies for years, presents detailed solutions for dealing with the aggravating problems they cause programmers.

About Matthew Wilson

MATTHEW WILSON is a software development consultant and creator of the STLSoft libraries. He writes a bi-monthly C/C++ Users Journal column on integrating C and C++ with different languages and technologies, as well as an online column for C++ Experts Forum. He has over a decade's experience developing with C++. Currently based in Australia, Wilson holds a Ph.D. from Manchester University (UK).


(c) Copyright Pearson Education. All rights reserved.

Table of Contents

I. FUNDAMENTALS.

1. Enforcing Design: Constraints, Contracts, and Assertions.

Eggs and Ham.

Compile-Time Contracts: Constraints.

Runtime Contracts: Preconditions, Postconditions, and Invariants.

Assertions.

2. Object Lifetime.

The Object Life Cycle.

Controlling Your Clients.

MILs and Boon.

3. Resource Encapsulation.

A Taxonomy of Resource Encapsulation.

POD Types.

Wrapper Proxies.

RRID Types.

RAII Types.

RAII Coda.

4. 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.

5. Object Access Models.

Vouched Lifetimes.

Copied for Caller.

Given to Caller.

Shared Objects.

6. Scoping Classes.

Value.

State.

APIs and Services.

Language Features.

II. SURVIVING THE REAL WORLD.

7. ABI.

Sharing Code.

C ABI Requirements.

C++ ABI Requirements.

I Can C Clearly Now.

8. Objects Across Borders.

Mostly Portable vtables?

Portable vtables.

ABI/OAB Coda.

9. Dynamic Libraries.

Calling Functions Explicitly.

Indentity: Link Units and Link Space.

Lifetime.

Versioning.

Resource Ownership.

Dynamic Libraries: Coda.

10. Threading.

Synchronizing Integer Access.

Synchronizing Block Access: Critical Regions.

Atomic Integer Performance.

Multithreading Extensions.

Thread Specific Storage.

11. Statics.

Nonlocal Static Objects: Globals.

Singletons.

Function-Local Static Objects.

Static Members.

Statics Coda.

12. Optimization.

Inline Functions.

Return Value Optimization.

Empty Base Optimization.

Empty Derived Optimization.

Preventing Optimization.

III. LANGUAGE CONCERNS.

13. Fundamental Types.

May I Have a byte?

Fixed-Sized Integer Types.

Large Integer Types.

Dangerous Types.

14. 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.

15. Values.

NULL-The Keyword That Wasn't.

Down to Zero.

Bending the Truth.

Literals.

Constants.

16. Keywords.

interface.

temporary.

owner.

explicit(_cast).

unique.

final.

Unsupported Keywords.

17. Syntax.

Class Layout.

Conditional Expressions.

for.

Variable Notation.

18. Typedefs.

Pointer typedefs.

What's in a Definition?

Aliases.

True Typedefs.

The Good, the Bad, and the Ugly.

IV. COGNIZANT CONVERSIONS.

19. 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.

20. 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.

21. Veneers.

Lightweight RAII.

Binding Data and Operations.

Rubbing Up to Concepts.

Veneers: Coda.

22. Bolt-ins.

Adding Functionality.

Skin Selection.

Nonvirtual Overriding.

Leveraging Scope.

Simulated Compile-Time Polymorphism: Reverse Bolt-ins.

Parameterized Polymorphic Packaging.

Bolt-ins: Coda.

23. Template Constructors.

Hidden Costs.

Dangling References.

Template Constructor Specialization.

Argument Proxies.

Argument Targeting.

Template Constructors: Coda.

V. OPERATORS.

24. 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!.

25. Fast, Non-intrusive String Concatenation.

fast_string_concatenator<>.

Performance.

Working with Other String Classes.

Concatenation Seeding.

Pathological Bracing.

Standardization.

26. 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.

27. Subscript Operators.

Pointer Conversion versus Subscript Operators.

Handling Errors.

Return Value.

28. Increment Operators.

Missing Postfix Operators.

Efficiency.

29. 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.

30. Short-circuit!

VI. EXTENDING C++.

31. 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.

32. Memory.

A Taxonomy of Memory.

The Best of Both Worlds.

Allocators.

Memory: Coda.

33. Multidimensional Arrays.

Facilitating Subscript Syntax.

Sized at Run Time.

Sized at Compile Time.

Block Access.

Performance.

Multidimensional Arrays: Coda.

34. Functors and Ranges.

Syntactic Clutter.

for_all() ?

Local Functors.

Ranges.

Functors and Ranges: Coda.

35. Properties.

Compiler Extensions.

Implementation Options.

Field Properties.

Method Properties.

Static Properties.

Virtual Properties.

Property Uses.

Properties: Coda.

Appendix A. Compilers and Libraries.

Compilers.

Libraries.

Other Resources.

Appendix B. "Watch That Hubris!"

Operator Overload.

DRY Rued Yesterday.

Paranoid Programming.

To Insanity, and Beyond!

Appendix C. Arturius.

Appendix D. The CD.

Epilogue.

Bibliography.

Index.

Additional information

CIN0321228774VG
9780321228772
0321228774
Imperfect C++: Practical Solutions for Real-Life Programming by Matthew Wilson
Used - Very Good
Hardback
Pearson Education (US)
2004-10-21
624
N/A
Book picture is for illustrative purposes only, actual binding, cover or edition may vary.
This is a used book - there is no escaping the fact it has been read by someone else and it will show signs of wear and previous use. Overall we expect it to be in very good condition, but if you are not entirely satisfied please get in touch with us

Customer Reviews - Imperfect C++