C++ Move Semantics and Value Categories: Perfect Forwarding, Reference Collapsing, RVO/NRVO, and Zero-Copy API Design in Modern C++. - Brossura

Libro 11 di 11: High-Performance C++ Engineering

S. Lightner, Billie

 
9798196253058: C++ Move Semantics and Value Categories: Perfect Forwarding, Reference Collapsing, RVO/NRVO, and Zero-Copy API Design in Modern C++.

Sinossi

Stop Guessing What std::move Actually Does. Master Value Categories and Engineer True Zero-Copy C++ APIs.

Modern C++ promises blistering performance through move semantics, but the reality in most codebases is very different. Misunderstanding value categories (xvalues, prvalues, glvalues) and the exact mechanics of std::move routinely leads to "silent copies", hidden performance regressions that destroy throughput in high-frequency trading, game engines, and low-latency systems.

C++ Move Semantics and Value Categories is the definitive, elite-level manual for unmasking the C++ type system. This book bridges the gap between high-level application code and raw compiler mechanics. You will learn exactly when the compiler generates special member functions, how reference collapsing actually works, and how to design APIs that transfer ownership across threads with zero overhead.
Inside, you will discover:

  • The Value Category Taxonomy: Finally demystify lvalues, rvalues, xvalues, and prvalues, and understand how the compiler uses them to drive optimization.
  • The std::move Trap: Understand why std::move doesn't actually move anything (it is just a cast), the importance of noexcept, and the exact state of a moved-from object.
  • The Forwarding Reference Enigma: Distinguish between true rvalue references and forwarding references (T&&), and master the reference collapsing rules that power std::forward.
  • Copy Elision & RVO/NRVO: Learn the exact compiler transformations behind Return Value Optimization, and discover the common coding anti-patterns that accidentally defeat guaranteed copy elision in C++17.
  • The Rule of Five vs. Rule of Zero: Navigate the complex matrix of compiler-generated special members and learn how user-declared destructors silently regress performance.
  • Zero-Copy API Design: Architect elite-level function boundaries using sink parameters, move-only types (sockets, GPU handles), and lock-free producer-consumer queues.
THE COMPILER'S VAULT (Appendix)

Built for the performance engineer who needs immediate, definitive answers, the Appendix provides drop-in reference material:
  • The Value Category Quick-Reference: The ultimate expression classification table.
  • Special Member Generation Decision Matrix: Never guess what the compiler is generating again. All six members mapped across every user-declaration scenario.
  • The Top 12 Move Semantics Pitfalls: The most common (and devastating) silent performance killers and their exact fixes.
Stop fighting the compiler. Master the rules of modern C++, eradicate silent copies, and design the fastest, safest APIs of your career.

Le informazioni nella sezione "Riassunto" possono far riferimento a edizioni diverse di questo titolo.