What is more common in your experience: func1() or funct2()?
void func1(unique_ptr<Bar>& bar) { /* alter pointed to object's attributes */ }
void func2(Bar* const bar) { /* alter pointed to object's attributes */ }
class Foo
{
unique_ptr<Bar> bar;
void mutate_bar1(){ func1(bar); }
void mutate_bar2(){ func2(bar.get()); }
}
Aucun commentaire:
Enregistrer un commentaire