Tagged articles
move semantics
16 articles · Page 1 of 1
This article presents a systematic approach to memory optimization across three dimensions—reducing allocation frequency, accelerating allocation speed, and improving memory usage efficiency—with practical C++ techniques including stack allocation, object pools, size-class allocators, huge pages, data structure packing, and false sharing prevention.
C++Performance Tuningdata structure alignment
0 likes · 23 min read

A concise vector reallocation example demonstrates how C++ permits use-after-free bugs that Rust catches at compile time via borrow checking, then explores ownership, move semantics, and thread-safety differences between the two languages.
C++Rustborrow checker
0 likes · 9 min read

This article systematically explains C++ reference‑count changes, the precise moments when ++/-- operators trigger in shared_ptr, move, copy, reset and destroy operations, and illustrates common mistakes with concrete code examples, helping developers and interviewees avoid subtle bugs and logic errors.
C++copy constructorincrement operator
0 likes · 20 min read

This article explores why efficient memory management is crucial for C++ performance and presents practical strategies—including stack allocation, RAII, smart pointers, custom memory pools, optimal containers, move semantics, and diagnostic tools—to write faster, more robust programs.
C++RAIImemory pool
0 likes · 9 min read

This article explains C++11 move semantics, covering the distinction between lvalues and rvalues, the role of rvalue references, how std::move enables resource stealing, and how to implement move constructors and move assignment operators for high‑performance code.
C++move semanticsresource management
0 likes · 11 min read

This article explains the concepts of lvalues and rvalues in C++, how std::move converts a named object into an rvalue to enable move semantics, and how std::forward preserves the original value category for perfect forwarding in template functions, illustrated with clear examples and code snippets.
C++lvaluemove semantics
0 likes · 26 min read

This article examines why std::vector can become a bottleneck when handling millions of elements, analyzes memory consumption, insertion/deletion costs, and cache behavior, and presents practical optimizations such as pre‑allocation, move semantics, SIMD vectorization, and cache‑friendly designs illustrated with real‑world case studies and code examples.
C++SIMDmemory optimization
0 likes · 21 min read

This article explains the concept of perfect forwarding in C++11, demonstrates how to preserve value categories using universal references and std::forward, and provides practical examples such as generic factory functions, wrapper functions, reference collapsing rules, and common pitfalls to avoid.
C++Universal Referencesmove semantics
0 likes · 21 min read

This article walks through the most impactful C++11 enhancements—including initializer lists, auto type deduction, decltype, smart pointers, lambda expressions, move semantics, range‑based for loops, nullptr, constexpr, type aliases, and the thread library—explaining their syntax, benefits, and practical usage with clear code examples.
C++11Threadauto
0 likes · 27 min read

This article explains C++ move semantics, covering the concepts of lvalues and rvalues, the syntax and rules of rvalue references, how std::move converts lvalues to rvalues, and demonstrates practical applications such as custom class move constructors, STL container optimizations, and return value optimization.
C++move semanticsrvalue references
0 likes · 21 min read

This article explains the seven default special member functions that C++ automatically provides for a class—including constructors, destructors, copy/move operations and address‑of operators—showing when they are sufficient, when they can cause problems such as shallow copies or double frees, and how to implement custom versions to ensure correct resource management.
C++constructorcopy semantics
0 likes · 17 min read

This article provides a comprehensive overview of C++11 enhancements, including list initialization, type deduction, constexpr, move semantics, perfect forwarding, lambda expressions, smart pointers, and new casting rules, with detailed explanations and code examples illustrating their syntax, behavior, and practical applications.
C++11CastingLambda Expressions
0 likes · 61 min read

The article explains how C++ value categories—lvalue, prvalue, and xvalue—govern function return handling, parameter passing, and object lifetimes, detailing hidden out‑parameters, copy‑elision, const‑reference lifetime extension, rvalue references, and the role of std::move in enabling move semantics.
C++assemblylvalue
0 likes · 47 min read

The article explains C++11 move semantics, showing how std::move forces rvalue treatment and how std::forward preserves value categories for perfect forwarding, illustrating copy vs. move constructors, custom move implementations, and the performance benefits of eliminating unnecessary copies.
C++C++11move semantics
0 likes · 20 min read

The article explains the different meanings of the && operator in C++—as a true rvalue reference in non‑template functions, as a forwarding (universal) reference in templates, and its behavior when binding to function return values—illustrated with code examples and practical guidelines.
C++Function ParametersTemplate
0 likes · 5 min read

Move semantics in C++11 let objects transfer ownership of resources via rvalue references and std::move, eliminating costly copies, improving performance, requiring explicit move constructors and assignment operators—preferably marked noexcept—to keep source objects valid, enable container optimizations, and work with NRVO when copying would otherwise occur.
C++C++11move semantics
0 likes · 23 min read
