vendredi 27 mai 2016

shared_ptr assignment notation implicit conversion

considering following code , Why I can’t use the assignment notation here , Why that is considered to be an implicit conversion.

shared_ptr<string> pNico = new string("nico"); // ERROR implicit conversion
shared_ptr<string> pNico{new string("nico")};   // OK

Aucun commentaire:

Enregistrer un commentaire