samedi 22 octobre 2016

push_back a PRvalue into a vector

Carefully reading the references, A move constructor can only be called by a Xvalue. Then, how something like...

std::vector<Class> vec(Class(..args..))

is possible without moving(casting) it to an Xvalue? Is there a specific way to use move semantics on PRvalues?

Aucun commentaire:

Enregistrer un commentaire