Lvalues, rvalues, glvalues, prvalues, xvalues, help (2018)

Lvalues, rvalues, glvalues, prvalues, xvalues, help (2018)

:)

Back before C++11, there were two value categories, lvalue and rvalue. The basic intuition was that lvalues were things with identities, such as variables, and rvalues were temporaries:

However, along came rvalue references and move semantics. It might help to think of “xvalue” as “eXpiring lvalue”, since they’re probably about to end their lifetime and be moved from (for instance a function returning an rvalue reference).

Source: blog.knatten.org

Leave a Reply

Your email address will not be published. Required fields are marked *