Effective C++, 3rd Edition
معرفی کتاب «Effective C++, 3rd Edition» نوشتهٔ Scott Meyers، منتشرشده توسط نشر Addison Wesley در سال 2005. این کتاب در 8 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Effective C++, 3rd Edition» در دستهٔ برنامهنویسی قرار دارد.
“Every C++ professional needs a copy of Effective C++. It is an absolute must-read for anyone thinking of doing serious C++ development. If you’ve never read Effective C++ and you think you know everything about C++, think again.” — Steve Schirripa, Software Engineer, Google “C++ and the C++ community have grown up in the last fifteen years, and the third edition of Effective C++ reflects this. The clear and precise style of the book is evidence of Scott’s deep insight and distinctive ability to impart knowledge.” — Gerhard Kreuzer, Research and Development Engineer, Siemens AG The first two editions of Effective C++ were embraced by hundreds of thousands of programmers worldwide. The reason is clear: Scott Meyers’ practical approach to C++ describes the rules of thumb used by the experts — the things they almost always do or almost always avoid doing — 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. For this third edition, more than half the content is new, including added chapters on managing resources and using templates. Topics from the second edition have been extensively revised to reflect modern design considerations, including exceptions, design patterns, and multithreading. Title Page 6 Copyright Page 7 Contents 12 Praise for Effective C++, Third Edition 2 Addison-Wesley Professional Computing Series 5 Preface 16 Acknowledgments 18 Introduction 22 Chapter 1: Accustoming Yourself to C++ 32 Item 1: View C++ as a federation of languages. 32 Item 2: Prefer consts, enums, and inlines to #defines. 34 Item 3: Use const whenever possible. 38 Item 4: Make sure that objects are initialized before they’re used. 47 Chapter 2: Constructors, Destructors, and Assignment Operators 55 Item 5: Know what functions C++ silently writes and calls. 55 Item 6: Explicitly disallow the use of compiler-generated functions you do not want. 58 Item 7: Declare destructors virtual in polymorphic base classes. 61 Item 8: Prevent exceptions from leaving destructors. 65 Item 9: Never call virtual functions during construction or destruction. 69 Item 10: Have assignment operators return a reference to *this. 73 Item 11: Handle assignment to self in operator=. 74 Item 12: Copy all parts of an object. 78 Chapter 3: Resource Management 82 Item 13: Use objects to manage resources. 82 Item 14: Think carefully about copying behavior in resource-managing classes. 87 Item 15: Provide access to raw resources in resource-managing classes. 90 Item 16: Use the same form in corresponding uses of new and delete. 94 Item 17: Store newed objects in smart pointers in standalone statements. 96 Chapter 4: Designs and Declarations 99 Item 18: Make interfaces easy to use correctly and hard to use incorrectly. 99 Item 19: Treat class design as type design. 105 Item 20: Prefer pass-by-reference-to-const to pass-by-value. 107 Item 21: Don’t try to return a reference when you must return an object. 111 Item 22: Declare data members private. 115 Item 23: Prefer non-member non-friend functions to member functions. 119 Item 24: Declare non-member functions when type conversions should apply to all parameters. 123 Item 25: Consider support for a non-throwing swap. 127 Chapter 5: Implementations 134 Item 26: Postpone variable definitions as long as possible. 134 Item 27: Minimize casting. 137 Item 28: Avoid returning “handles” to object internals. 144 Item 29: Strive for exception-safe code. 148 Item 30: Understand the ins and outs of inlining. 155 Item 31: Minimize compilation dependencies between files. 161 Chapter 6: Inheritance and Object-Oriented Design 170 Item 32: Make sure public inheritance models “is-a.” 171 Item 33: Avoid hiding inherited names. 177 Item 34: Differentiate between inheritance of interface and inheritance of implementation. 182 Item 35: Consider alternatives to virtual functions. 190 Item 36: Never redefine an inherited non-virtual function. 199 Item 37: Never redefine a function’s inherited default parameter value. 201 Item 38: Model “has-a” or “is-implemented-in-terms- of” through composition. 205 Item 39: Use private inheritance judiciously. 208 Item 40: Use multiple inheritance judiciously. 213 Chapter 7: Templates and Generic Programming 220 Item 41: Understand implicit interfaces and compile-time polymorphism. 220 Item 42: Understand the two meanings of typename. 224 Item 43: Know how to access names in templatized base classes. 228 Item 44: Factor parameter-independent code out of templates. 233 Item 45: Use member function templates to accept “all compatible types.” 239 Item 46: Define non-member functions inside templates when type conversions are desired. 243 Item 47: Use traits classes for information about types. 247 Item 48: Be aware of template metaprogramming. 254 Chapter 8: Customizing new and delete 260 Item 49: Understand the behavior of the new-handler. 261 Item 50: Understand when it makes sense to replace new and delete. 268 Item 51: Adhere to convention when writing new and delete. 273 Item 52: Write placement delete if you write placement new. 277 Chapter 9: Miscellany 283 Item 53: Pay attention to compiler warnings. 283 Item 54: Familiarize yourself with the standard library, including TR1. 284 Item 55: Familiarize yourself with Boost. 290 Appendix A: Beyond Effective C++ 294 Appendix B: Item Mappings Between Second and Third Editions 298 Index 301 A 301 B 301 C 302 D 304 E 305 F 308 G 309 H 309 I 309 J 310 K 311 L 311 M 311 N 312 O 312 P 313 R 314 S 315 T 316 U 317 V 317 W 318 X 318 Z 318 "This is Effective C++ volume three – it's really that good." – Herb Sutter, independent consultant and secretary of the ISO/ANSI C++ standards committee "There are very few books which all C++ programmers must have. Add Effective STL to that list." – Thomas Becker, Senior Software Engineer, Zephyr Associates, Inc., and columnist, C/C++ Users Journal C++'s Standard Template Library is revolutionary, but learning to use it well has always been a challenge. Until now. In this book, best-selling author Scott Meyers ( Effective C++ , and More Effective C++ ) reveals the critical rules of thumb employed by the experts – the things they almost always do or almost always avoid doing – to get the most out of the library. Other books describe what's in the STL. Effective STL shows you how to use it . Each of the book's 50 guidelines is backed by Meyers' legendary analysis and incisive examples, so you'll learn not only what to do, but also when to do it – and why . Highlights of Effective STL include: 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. Like Meyers' previous books, Effective STL is filled with proven wisdom that comes only from experience. Its clear, concise, penetrating style makes it an essential resource for every STL programmer. More than 150,000 copies in print! Praise for Scott Meyers' first book, Effective C++ : "I heartily recommend Effective C++ to anyone who aspires to mastery of C++ at the intermediate level or above." – The C/C++ User's Journal From the author of the indispensable Effective C++ , here are 35 new 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. More Effective C++ includes: 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. More Effective C++ is filled with pragmatic, down-to-earth advice you'll use every day. Like Effective C++ before it, More Effective C++ is essential reading for anyone working with C++. This is the eBook version of the printed book. From the author of the indispensable Effective C++ , here are 35 new 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. More Effective C++ includes: 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. More Effective C++ is filled with pragmatic, down-to-earth advice you’ll use every day. Like Effective C++ before it, More Effective C++ is essential reading for anyone working with C++.
دانلود کتاب Effective C++, 3rd Edition