C++ Core Guidelines Explained

Best Practices for Modern C++

E-book Engels 2022 9780136875611
Verwachte levertijd ongeveer 9 werkdagen

Samenvatting

Write More Elegant C++ Programs

The official C++ Core Guidelines provide consistent best practices for writing outstanding modern C++ code and improving legacy code, but they're organized as a reference for looking up one specific point at a time, not as a tutorial for working developers. In C++ Core Guidelines Explained, expert C++ instructor Rainer Grimm has distilled them to their essence, removing esoterica, sharing new insights and context, and presenting well-tested examples from his own training courses.

Grimm helps experienced C++ programmers use the Core Guidelines with any recent version of the language, from C++11 onward. Most of his code examples are written for C++17, with added coverage of newer versions and C++20 wherever appropriate, and references to the official C++ Core Guidelines online.

Whether you're creating new software or improving legacy code, Grimm will help you get more value from the Core Guidelines' most useful rules, as you write code that's safer, clearer, more efficient, and easier to maintain. Apply the guidelines and underlying programming philosophy Correctly use interfaces, functions, classes, enum, resources, expressions, and statements Optimize performance, implement concurrency and parallelism, and handle errors Work effectively with constants, immutability, templates, generics, and metaprogramming Improve your C++ style, manage source files, and use the Standard Library

"We are very pleased to see Rainer Grimm applying his teaching skills and industrial background to tackling the hard and necessary task of making the C++ Core Guidelines accessible to more people."
--Bjarne Stroustrup and Herb Sutter, co-editors, C++ Core Guidelines

Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

Specificaties

ISBN13:9780136875611
Taal:Engels
Bindwijze:e-book

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Inhoudsopgave

List of selected C++ Core Guidelines xiii <br> List of figures xxiii <br> List of tables xxvii <br> Foreword xxix <br> Preface xxxi <br> Acknowledgments xxxvii <br> About the author xxxix <br> <br> Part I: The Guidelines 1 <br> <br> Chapter 1: Introduction 3 <br>Target readership 3 <br>Aim 4 <br>Non-aims 4 <br>Enforcement 4 <br>Structure 4 <br>Major sections 5 <br> <br> Chapter 2: Philosophy 7 <br> <br> Chapter 3: Interfaces 15 <br>The curse of non-const global variables 16 <br>Dependency injection as a cure 18 <br>Making good interfaces 20 <br>Related rules 25 <br> <br> Chapter 4: Functions 27 <br>Function definitions 28 <br>Parameter passing: in and out 32 <br>Parameter passing: ownership semantics 38 <br>Value return semantics 42 <br>Other functions 46 <br>Related rules 52 <br> <br> Chapter 5: Classes and Class Hierarchies 53 <br>Summary rules 54 <br>Concrete types 58 <br>Constructors, assignments, and destructors 59 <br>Class hierarchies 98 <br>Overloading and overloaded operators 117 <br>Unions 126 <br>Related rules 129 <br> <br> Chapter 6: Enumerations 131 <br>General rules 131 <br>Related rules 137 <br> <br> Chapter 7: Resource Management 139 <br>General rules 140 <br>Allocation and deallocation 145 <br>Smart pointers 150 <br>Related rules 164 <br> <br> Chapter 8: Expressions and Statements 165 <br>General 166 <br>Declarations 168 <br>Expressions 186 <br>Statements 199 <br>Arithmetic 204 <br>Related rules 210 <br> <br> Chapter 9: Performance 213 <br>Wrong optimizations 214 <br>Wrong assumptions 214 <br>Enable optimization 218 <br>Related rules 230 <br> <br> Chapter 10: Concurrency 231 <br>General guidelines 232 <br>Concurrency 245 <br>Parallelism 266 <br>Message passing 269 <br>Lock-free programming 273 <br>Related rules 277 <br> <br> Chapter 11: Error Handling 279 <br>Design 281 <br>Implementation 283 <br>If you can't throw 288 <br>Related rules 292 <br> <br> Chapter 12: Constants and Immutability 293 <br>Use const 294 <br>Use constexpr 298 <br> <br> Chapter 13: Templates and Generic Programming 301 <br>Use 302 <br>Interfaces 305 <br>Definition 320 <br>Hierarchies 330 <br>Variadic templates 332 <br>Metaprogramming 336 <br>Other rules 362 <br>Related rules 372 <br> <br> Chapter 14: C-Style Programming 375 <br>Entire source code available 376 <br>Entire source code not available 378 <br> <br> Chapter 15: Source Files 383 <br>Interface and implementation files 384 <br>Namespaces 391 <br> <br> Chapter 16: The Standard Library 397 <br>Containers 398 <br>Text 404 <br>Input and output 411 <br>Related rules 419 <br> <br> Part II: Supporting Sections 421 <br> <br> Chapter 17: Architectural Ideas 423 <br> <br> Chapter 18: Nonrules and Myths 427 <br> <br> Chapter 19: Profiles 437 <br>Pro.typeType safety 438 <br>Pro.boundsBounds safety 439 <br>Pro.lifetimeLifetime safety 439 <br> <br> Chapter 20: Guidelines Support Library 441 <br>Views 441 <br>Ownership pointers 442 <br>Assertions 443 <br>Utilities 443 <div> <br> </div> <div> Part III: Appendixes 445 <br> <br> Appendix A: Enforcing the C++ Core Guidelines 447 <br>Visual Studio 448 <br>clang-tidy 450 <br> <br> Appendix B: Concepts 453 <br> <br> Appendix C: Contracts 457 <br> <br> Index 459 </div>

Managementboek Top 100

Rubrieken

Populaire producten

    Personen

      Trefwoorden

        C++ Core Guidelines Explained