samedi 25 mars 2017

Why I can't assign , &client object created by new to unique_ptr

I know there are other ways to do this. But I decide to experiment this:

    unique_ptr<int> pi;
    pi = std::move(new int);

When I compile this code, the compiler gives an error. why?

Aucun commentaire:

Enregistrer un commentaire