0

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

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

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

Ray Kim
  • 33
  • 2
  • 8
  • move semantics were invented for (p)rvalues. I think you were referring to the intro of http://en.cppreference.com/w/cpp/language/move_constructor - it has now been updated. – Cubbi Oct 23 '16 at 20:04
  • also note your example doesn't match your question title: where is the push_back? – Cubbi Oct 23 '16 at 20:05
  • Ah sorry. Seems like I made a mistake. I'll edit it – Ray Kim Oct 23 '16 at 23:36

0 Answers0