lundi 1 juillet 2019

Is a forvarding reference still an rvalue reference or not?

I'm still confused by the rules invented to support moving and forwarding. One thing I'm still not sure about is:

Is a forwarding reference just an rvalue reference (with reference collapsing rules applied)?

If it is an rvalue reference, then why does the function:

template<typename T>
void func(T&&);

accepts not only rvalues, but also lvalues?

Aucun commentaire:

Enregistrer un commentaire