dimanche 28 juin 2020

Can std::move move a built-in types or c pointer or array

1.can std::move move a built-in type

int a = 10;
int b = std::move(a);

will a be a invalid value?

  1. can std::move move a pointer
    int *a = new int[10];
    int *b = std::move(a);

will a become a invalid pointer or nullptr?

  1. can std::move move an c array
int a[10];
int b[10];
b = std::move(a);

will a become an invalid array?

Aucun commentaire:

Enregistrer un commentaire