Buy Effective C++ Digital Collection by Scott Meyers
close menu
Bookswagon
search
My Account
Book 1
Book 2
Book 3
Book 1
Book 2
Book 3
Book 1
Book 2
Book 3
Book 1
Book 2
Book 3
Home > Computing and Information Technology Books > Computer programming / software engineering > Programming and scripting languages: general > Effective C++ Digital Collection: 140 Ways to Improve Your Programming
Effective C++ Digital Collection: 140 Ways to Improve Your Programming

Effective C++ Digital Collection: 140 Ways to Improve Your Programming


     0     
5
4
3
2
1



Out of Stock


Notify me when this book is in stock
X
About the Book

Scott Meyers’s seminal C++ books–Effective C++, More Effective C++, and Effective STL–have been immensely helpful to hundreds of thousands of C++ programmers. All three are finally available together in this eBook collection.

 

Effective C++ has been embraced by hundreds of thousands of programmers worldwide. The reason is clear: Scott Meyers’s practical approach to C++ describes the rules of thumb used by the experts to produce clear, correct, efficient code. The book is organized around 55 specific guidelines, each of which describes a way to write better C++. Each is backed by concrete examples.

 

In More Effective C++, Meyers presents 35 ways to improve your programs and designs. Drawing on years of experience, Meyers explains how to write software that is more effective: more efficient, more robust, more consistent, more portable, and more reusable. In short, how to write C++ software that’s just plain better.

 

In Effective STL, Meyers goes beyond describing what's in the STL to show you how to use it. Each of the book’s 50 guidelines is backed by Meyers’s legendary analysis and incisive examples, so you’ll learn not only what to do, but also when to do it–and why.

 

Together in this collection, these books include the following important features:

  • Expert guidance on the design of effective classes, functions, templates, and inheritance hierarchies.
  • Applications of new “TR1” standard library functionality, along with comparisons to existing standard library components.
  • Insights into differences between C++ and other languages (e.g., Java, C#, C) that help developers from those languages assimilate “the C++ way” of doing things.
  • Proven methods for improving program efficiency, including incisive examinations of the time/space costs of C++ language features
  • Comprehensive descriptions of advanced techniques used by C++ experts, including placement new, virtual constructors, smart pointers, reference counting, proxy classes, and double-dispatching
  • Examples of the profound impact of exception handling on the structure and behavior of C++ classes and functions
  • Practical treatments of new language features, including bool, mutable, explicit, namespaces, member templates, the Standard Template Library, and more. If your compilers don’t yet support these features, Meyers shows you how to get the job done without them.
  • Advice on choosing among standard STL containers (like vector and list), nonstandard STL containers (like hash_set and hash_map), and non-STL containers (like bitset).
  • Techniques to maximize the efficiency of the STL and the programs that use it.
  • Insights into the behavior of iterators, function objects, and allocators, including things you should not do.
  • Guidance for the proper use of algorithms and member functions whose names are the same (e.g., find), but whose actions differ in subtle (but important) ways.
  • Discussions of potential portability problems, including straightforward ways to avoid them.


Table of Contents:

Effective C++

 

Introduction 1A

 

Chapter 1: Accustoming Yourself to C++ 11A

Item 1: View C++ as a federation of languages. 11A

Item 2: Prefer consts, enums, and inlines to #defines. 13A

Item 3: Use const whenever possible. 17A

Item 4: Make sure that objects are initialized before they’re used. 26A

 

Chapter 2: Constructors, Destructors, and Assignment Operators 34A

Item 5: Know what functions C++ silently writes and calls. 34A

Item 6: Explicitly disallow the use of compiler-generated functions you do not want. 37A

Item 7: Declare destructors virtual in polymorphic base classes. 40A

Item 8: Prevent exceptions from leaving destructors. 44A

Item 9: Never call virtual functions during construction or destruction. 48A

Item 10: Have assignment operators return a reference to *this. 52A

Item 11: Handle assignment to self in operator=. 53A

Item 12: Copy all parts of an object. 57A

 

Chapter 3: Resource Management 61A

Item 13: Use objects to manage resources. 61A

Item 14: Think carefully about copying behavior in resourcemanaging classes. 66A

Item 15: Provide access to raw resources in resourcemanaging classes. 69A

Item 16: Use the same form in corresponding uses of new and delete. 73A

Item 17: Store newed objects in smart pointers in standalone statements. 75A

 

Chapter 4: Designs and Declarations 78A

Item 18: Make interfaces easy to use correctly and hard to use incorrectly. 78A

Item 19: Treat class design as type design. 84A

Item 20: Prefer pass-by-reference-to-const to pass-by-value. 86A

Item 21: Don’t try to return a reference when you must return an object. 90A

Item 22: Declare data members private. 94A

Item 23: Prefer non-member non-friend functions to member functions. 98A

Item 24: Declare non-member functions when type conversions should apply to all parameters. 102A

Item 25: Consider support for a non-throwing swap. 106A

 

Chapter 5: Implementations 113A

Item 26: Postpone variable definitions as long as possible. 113A

Item 27: Minimize casting. 116A

Item 28: Avoid returning “handles” to object internals. 123A

Item 29: Strive for exception-safe code. 127A

Item 30: Understand the ins and outs of inlining. 134A

Item 31: Minimize compilation dependencies between files. 140A

 

Chapter 6: Inheritance and Object-Oriented Design 149A

Item 32: Make sure public inheritance models “is-a.” 150A

Item 33: Avoid hiding inherited names. 156A

Item 34: Differentiate between inheritance of interface and inheritance of implementation. 161A

Item 35: Consider alternatives to virtual functions. 169A

Item 36: Never redefine an inherited non-virtual function. 178A

Item 37: Never redefine a function’s inherited default parameter value. 180A

Item 38: Model “has-a” or “is-implemented-in-terms-of” through composition. 184A

Item 39: Use private inheritance judiciously. 187A

Item 40: Use multiple inheritance judiciously. 192A

 

Chapter 7: Templates and Generic Programming 199A

Item 41: Understand implicit interfaces and compile-time polymorphism. 199A

Item 42: Understand the two meanings of typename. 203A

Item 43: Know how to access names in templatized base classes. 207A

Item 44: Factor parameter-independent code out of templates. 212A

Item 45: Use member function templates to accept “all compatible types.” 218A

Item 46: Define non-member functions inside templates when type conversions are desired. 222A

Item 47: Use traits classes for information about types. 226A

Item 48: Be aware of template metaprogramming. 233A

 

Chapter 8: Customizing new and delete 239A

Item 49: Understand the behavior of the new-handler. 240A

Item 50: Understand when it makes sense to replace new and delete. 247A

Item 51: Adhere to convention when writing new and delete. 252A

Item 52: Write placement delete if you write placement new. 256A

Chapter 9: Miscellany 262A

Item 53: Pay attention to compiler warnings. 262A

Item 54: Familiarize yourself with the standard library, including TR1. 263A

Item 55: Familiarize yourself with Boost. 269A

 

Appendix A: Beyond Effective C++ 273A

Appendix B: Item Mappings Between Second and Third Editions 277A

 

Index 280A

 

More Effective C++

 

Introduction 1B

 

Basics 9B

Item 1: Distinguish between pointers and references. 9B

Item 2: Prefer C++-style casts. 12B

Item 3: Never treat arrays polymorphically. 16B

Item 4: Avoid gratuitous default constructors. 19B

 

Operators 24B

Item 5: Be wary of user-defined conversion functions. 24B

Item 6: Distinguish between prefix and postfix forms of increment and decrement operators. 31B

Item 7: Never overload &&, ||, or ,. 35B

Item 8: Understand the different meanings of new and delete. 38B

 

Exceptions 44B

Item 9: Use destructors to prevent resource leaks. 45B

Item 10: Prevent resource leaks in constructors. 50B

Item 11: Prevent exceptions from leaving destructors. 58B

Item 12: Understand how throwing an exception differs from passing a parameter or calling a virtual function. 61B

Item 13: Catch exceptions by reference. 68B

Item 14: Use exception specifications judiciously. 72B

Item 15: Understand the costs of exception handling. 78B

 

Efficiency 81B

Item 16: Remember the 80-20 rule. 82B

Item 17: Consider using lazy evaluation. 85B

Item 18: Amortize the cost of expected computations. 93B

Item 19: Understand the origin of temporary objects. 98B

Item 20: Facilitate the return value optimization. 101B

Item 21: Overload to avoid implicit type conversions. 105B

Item 22: Consider using op= instead of stand-alone op. 107B

Item 23: Consider alternative libraries. 110B

Item 24: Understand the costs of virtual functions, multiple inheritance, virtual base classes, and RTTI. 113B

 

Techniques 123B

Item 25: Virtualizing constructors and non-member functions. 123B

Item 26: Limiting the number of objects of a class. 130B

Item 27: Requiring or prohibiting heap-based objects. 145B

Item 28: Smart pointers. 159B

Item 29: Reference counting. 183B

Item 30: Proxy classes. 213B

Item 31: Making functions virtual with respect to more than one object. 228B

 

Miscellany 252B

Item 32: Program in the future tense. 252B

Item 33: Make non-leaf classes abstract. 258B

Item 34: Understand how to combine C++ and C in the same program. 270B

Item 35: Familiarize yourself with the language standard. 277B

 

Recommended Reading 285B

An auto_ptr Implementation 291B

 

General Index 295B

Index of Example Classes, Functions, and Templates 313B

 

Effective STL

 

Introduction 1C

 

Chapter 1: Containers 11C

Item 1: Choose your containers with care. 11C

Item 2: Beware the illusion of container-independent code. 15C

Item 3: Make copying cheap and correct for objects in containers. 20C

Item 4: Call empty instead of checking size() against zero. 23C

Item 5: Prefer range member functions to their single-element counterparts. 24C

Item 6: Be alert for C++’s most vexing parse. 33C

Item 7: When using containers of newed pointers, remember to delete the pointers before the container is destroyed. 36C

Item 8: Never create containers of auto_ptrs. 40C

Item 9: Choose carefully among erasing options. 43C

Item 10: Be aware of allocator conventions and restrictions. 48C

Item 11: Understand the legitimate uses of custom allocators. 54C

Item 12: Have realistic expectations about the thread safety of STL containers. 58C

 

Chapter 2: vector and string 63C

Item 13: Prefer vector and string to dynamically allocated arrays. 63C

Item 14: Use reserve to avoid unnecessary reallocations. 66C

Item 15: Be aware of variations in string implementations. 68C

Item 16: Know how to pass vector and string data to legacy APIs. 74C

Item 17: Use “the swap trick” to trim excess capacity. 77C

Item 18: Avoid using vector. 79C

 

Chapter 3: Associative Containers 83C

Item 19: Understand the difference between equality and equivalence. 83C

Item 20: Specify comparison types for associative containers of pointers. 88C

Item 21: Always have comparison functions return false for equal values. 92C

Item 22: Avoid in-place key modification in set and multiset. 95C

Item 23: Consider replacing associative containers with sorted vectors. 100C

Item 24: Choose carefully between map::operator[] and map::insert when efficiency is important. 106C

Item 25: Familiarize yourself with the nonstandard hashed containers. 111C

 

Chapter 4: Iterators 116C

Item 26: Prefer iterator to const_iterator, reverse_iterator, and const_reverse_iterator. 116C

Item 27: Use distance and advance to convert a container’s const_iterators to iterators. 120C

Item 28: Understand how to use a reverse_iterator’s base iterator. 123C

Item 29: Consider istreambuf_iterators for character-bycharacter input. 126C

 

Chapter 5: Algorithms 128C

Item 30: Make sure destination ranges are big enough. 129C

Item 31: Know your sorting options. 133C

Item 32: Follow remove-like algorithms by erase if you really want to remove something. 139C

Item 33: Be wary of remove-like algorithms on containers of pointers. 143C

Item 34: Note which algorithms expect sorted ranges. 146C

Item 35: Implement simple case-insensitive string comparisons via mismatch or lexicographical_compare. 150C

Item 36: Understand the proper implementation of copy_if. 154C

Item 37: Use accumulate or for_each to summarize ranges. 156C

 

Chapter 6: Functors, Functor Classes, Functions, etc. 162C

Item 38: Design functor classes for pass-by-value. 162C

Item 39: Make predicates pure functions. 166C

Item 40: Make functor classes adaptable. 169C

Item 41: Understand the reasons for ptr_fun, mem_fun, and mem_fun_ref. 173C

Item 42: Make sure less means operator<. 177C

 

Chapter 7: Programming with the STL 181C

Item 43: Prefer algorithm calls to hand-written loops. 181C

Item 44: Prefer member functions to algorithms with the same names. 190C

Item 45: Distinguish among count, find, binary_search, lower_bound, upper_bound, and equal_range. 192C

Item 46: Consider function objects instead of functions as algorithm parameters. 201C

Item 47: Avoid producing write-only code. 206C

Item 48: Always #include the proper headers. 209C

Item 49: Learn to decipher STL-related compiler diagnostics. 210C

Item 50: Familiarize yourself with STL-related web sites. 217C

 

Bibliography 225C

Appendix A: Locales and Case-Insensitive String Comparisons 229C

Appendix B: Remarks on Microsoft’s STL Platforms 239C

 

Index 245C



About the Author :

Scott Meyers is one of the world's foremost authorities on C++, providing training and consulting services to clients worldwide. He is the author of the best-selling Effective C++ series of books (Effective C++, More Effective C++, and Effective STL) and of the innovative Effective C++ CD. He is consulting editor for Addison Wesley's Effective Software Development Series and is a founding member of the Advisory Board for The C++ Source (http://www.artima.com/cppsource). He holds a Ph.D. in Computer Science from Brown University. His web site is http://www.aristeia.com.


Best Sellers


Product Details
  • ISBN-13: 9780132979184
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Addison Wesley
  • Language: English
  • Sub Title: 140 Ways to Improve Your Programming
  • ISBN-10: 0132979187
  • Publisher Date: 10 Jul 2012
  • Binding: SA
  • No of Pages: 930
  • Weight: 1 gr


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Effective C++ Digital Collection: 140 Ways to Improve Your Programming
Pearson Education (US) -
Effective C++ Digital Collection: 140 Ways to Improve Your Programming
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Effective C++ Digital Collection: 140 Ways to Improve Your Programming

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!