jeudi 26 mai 2016

What is the appropriate smart pointer to use when passing an object to a function which will create it

If I have a setup as below, what would be an appropriate smart pointer type to use? Or is this a case where a raw pointer should be used instead?

void factory (some_ptr_type_here<A> a)
{
    a = some_type_of_new<A>(...,..);
}
some_ptr_type_here<A> a;
factory(a);

Aucun commentaire:

Enregistrer un commentaire