Effective Modern C++
Learn how to program expertly with C++ with this practical book from Scott Meyers, one of the world's foremost authorities on this systems programming language. Scott Meyers takes some of the most difficult pieces of C++ code and unfurls them so that you can see how to manipulate your own project coPraise for effective Modern ct+So, still interested in C++? You should be! Modern C++(i.e, C++11/C++14)is far more than just a facelift. Considering the new features, it seems that it'smore a reinvention. Looking for guidelines and assistance? Then this bookis surely what you are looking for Concerning C++, Scott Meyers wasand still is a synonym for accuracy, quality, and delight-Gerhard KreuzerResearch and Development engineer, Siemens AgFinding utmost expertise is hard enough. Finding teaching perfectionisman author's obsession with strategizing and streamlining explanations-is also difficultYou know you're in for a treat when you get to find both embodied in the same personEffective Modern C++ is a towering achievement from a consummate technical writerIt layers lucid, meaningful, and well-sequenced clarifications on top of complex andinterconnected topics, all in crisp literary style. You' re equally unlikely to find atechnical mistake, a dull moment, or a lazy sentence in Effective Modern C++Andrei alexandrPh. D, Research Scientist, Facebook, and author of Modern C++ designAs someone with over two decades of C++ experience, to get the most out ofmodern C++(both best practices and pitfalls to avoid), I highly recommendgetting this book, reading it thoroughly, and referring to it oftenIve certainly learned new things going through itNevin liberSenior Software Engineer, DRW Trading GroupBjarne Stroustrup-the creator of C++-said, C++1l feels like a new languageEffective Modern C++ makes us share this same feeling by clearly explaininghow everyday programmers can benefit from new features and idiomsof C++ll and C++14. Another great Scott Meyers bookCassio neriFX Quantitative Analyst, Lloyds Banking Groupwww.it-ebooks.infoScott has the knack of boiling technical complexity down to an understandable kernellis Effective C++ books helped to raise the coding style of a previous generation of C++programmers; the new book seems positioned to do the same for those using modern C++-Roger OrrOR/2 Limited, a member of the Iso c++ standards committeeEffective Modern C++ is a great tool to improve your modern C++ skills. Not only does itteach you how, when and where to use modern C++ and be effective, it also explains whyWithout doubt, Scotts clear and insightful writing, spread over 42 well-thought items,gives programmers a much better understanding of the languagebart vandewoestyneResearch and Development Engineer and C++ enthusiastI love C++, it has been my work vehicle for many decades now. And withwou the latest raft of features it is even more powerful and expressive than Iwould have previously imagined. But with all this choice comes the questionwhen and how do i apply these features? As has always been the case,Scott's Effective C++ books are the definitive answer to this questionDamien watkinsComputation Software Engineering Team Lead, CSIROGreat read for transitioning to modern C++-new C++11/14language features are described alongside C++98, subject items areeasy to reference, and advice summarized at the end of each sectionEntertaining and useful for both casual and advanced C++ developersRachel chengF5 NetworksIf you're migrating from C++98/03 to C++11/14, you need the eminently practical andclear information Scott provides in Effective Modern C++. If you're already writingC++ll code, you'll probably discover issues with the new features through Scott'sthorough discussion of the important new features of the language. Either way, this bookis worth your timeRob stewartBoost Steering Committee member(boost. org)www.it-ebooks.infoEffective modern ct+Scott MeyersBeng. Cambridge. Farnham·Kn· Sebastopol, Tokyo OREILLY°www.it-ebooks.infoEffective Modern c++by scott meyersCopyright O 2015 Scott Meyers. All rights reservedPrinted in the CanadaPublished by O Reilly Media, Inc, 1005 Gravenstein Highway North, Sebastopol, CA 95472O Reilly books may be purchased for educational, business, or sales promotional use Online editions arealsoavailableformosttitles(http://safaribooksonline.com).Formoreinformationcontactourcorporateinstitutionalsalesdepartment800-998-9938orcorporate@oreilly.comEditor: Rachel roumeliotisProofreader: Charles roumeliotisProduction Editor: Melanie yarbroughIndexer: Scott MeyersCopyeditor: Jasmine KwitynInterior Designer: David FutatoCover Designer: Ellie VolkhausenIllustrator: Rebecca demarestNovember 2014first editionRevision History for the first Edition2014-11-07: First ReleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=9781491903995forreleasedetailsThe O Reilly logo is a registered trademark of O Reilly Media, Inc. Effective Modern C++, the cover imageof a Rose-crowned fruit Dove and related trade dress are trademarks of o reilly media, IncWhile the publisher and the author have used good faith efforts to ensure that the information andinstructions contained in this work are accurate, the publisher and the author disclaim all responsibilityfor errors or omissions, including without limitation responsibility for damages resulting from the use ofor reliance on this work. Use of the information and instructions contained in this work is at your ownrisk. If any code samples or other technology this work contains or describes is subject to open sourcelicenses or the intellectual property rights of others, it is your responsibility to ensure that your usethereof complies with such licenses and/or rights978-1-491-90399-5www.it-ebooks.infoFor darlablack labrador retriever extraordinairewww.it-ebooks.infowww.it-ebooks.infoTable of contentsFrom the publisherAcknowledgmentsIntroduction1. Deducing Types..........鲁·鲁··鲁鲁·鲁Item 1: Understand template type deductionItem 2: Understand auto type deduction18Item 3: Understand decltype23Item 4: Know how to view deduced types2. auto.............4.....9.......37Item 5: Prefer auto to explicit type declarations7Item 6: Use the explicitly typed initializer idiom when auto deducesundesired types433. Moving to modern c++Item 7: Distinguish between () and i when creating objects49Item 8: Prefer nullptr to o and NULL58Item 9: Prefer alias declarations to typedefsItem 10: Prefer scoped enums to unscoped enums67Item 11: Prefer deleted functions to private undefined onesItem 12: Declare overriding functions overrideItem 13: Prefer const iterators to iterators86Item 14: Declare functions noexcept if they wont emit exceptionsItem 15: Use constexpr whenever possible7www.it-ebooks.infoItem 16 Make const member functions thread safe103Item 17: Understand special member function generation1094. Smart pointers117Item 18: Use std: unique_ptr for exclusive-ownership resourcemanagement118Item 19: Use std: shared_ptr for shared-ownership resourcemanagement125Item 20: Use std: weak_ptr for std: shared_ptr-like pointers that can134Item 21: Prefer std: make unique and std: make shared to direct use ofnew139Item 22: When using the Pimpl Idiom, define special member functions inthe implementation file1475. Rvalue References, Move Semantics, and Perfect Forwarding.......... 157Item 23: Understand std:: move and std:: forward158Item 24: Distinguish universal references from rvalue references164Item 25: Use std:: move on rvalue references std: forward on universalreferences168Item 26: Avoid overloading on universal references177Item 27: Familiarize yourself with alternatives to overloading on universalreferer184Item 28: Understand reference collapsing197Item 29: Assume that move operations are not present, not cheap, and not203Item 30: Familiarize yourself with perfect forwarding failure cases2076. Lambda Expressions............................ 215Item 31: Avoid default capture modes216Item 32: Use init capture to move objects into closures224Item 33: Use decltype on auto& parameters to std: forward them229Item 34: Prefer lambdas to std: bind2327. The concurrency apl,,,241Item 35: Prefer task-based programming to thread-based241Item 36: Specify std: Launch: async if asynchronicity is essential245Item 37: Make std:: threads unjoinable on all paths250Item 38: Be aware of varying thread handle destructor behavior258Item 39 Consider void futures for one-shot event communication262viii Table of Contentswww.it-ebooks.info
暂无评论