lundi 7 septembre 2020

Difference between std::move and assignment in C++ [duplicate]

struct A{};

A test() {
  return A();
}

int main() {
  A a = test();
  A b = move(test());
  A c(move(test()));
}

Which method is better for "transferring" the value of test into my scope?

Aucun commentaire:

Enregistrer un commentaire