mercredi 17 mai 2023

What is the difference between & and && [closed]

What is the difference between the & and && operators in C++11?

According to the docs, && acts as an rvalue reference. It may be used in-conjunction with std::move to reference expressions (whether they have an identity or not).

& is also acting as a rvalue reference. It is used to reference an lvalue (object with an identifiable location in memory). Therefore & cannot be used with expressions.

Is this correct?

Aucun commentaire:

Enregistrer un commentaire