References in C++

Previous: C++

Added in C++11 was the distinction between lvalue and rvalue references, which enabled the possibility of many new features mainly move semantics. References are not objects, they are typically implemented as pointers underneath, and their primary purpose is to serve as an alias for another value. They are supplied with more safety constraints and better syntax than raw pointers. That said, they do also suffer from issues like dangling that pointers do.

Links to this note