C++ lvalues and rvalues explained

Small C++ learning today: Guess the output process("hello"); // rvalue process(s);   // lvalue -A named variable like `s` is an lvalue -A temporary value like `"hello"` is an rvalue That one idea explains why C++ has both string& and string&& and why move semantics matter so much in modern C++. #CPlusPlus #ModernCpp #CppProgramming #MoveSemantics #RvalueReference #Lvalue #ProgrammingConcepts #SoftwareEngineering #SystemsProgramming #LearningInPublic #100DaysOfCode #CodeNewbie

  • text

To view or add a comment, sign in

Explore content categories