samedi 20 août 2016

How does std forward taking rvalue argument binds to the lvaue param reference

This is the declaration of std::forward

template< class T >
T&& forward( typename std::remove_reference<T>::type& t );

How does this pure rvalue string "HelloWorld!" bind to t as an lvalue reference in std::forward?

std::string&& rstr = std::forward<std::string>("HelloWorld!");

Aucun commentaire:

Enregistrer un commentaire