When a function should take a boost::shared_ptr
, are you passing it
by const reference void foo(const boost::shared_ptr<T>& p)
or by value void foo(boost::shared_ptr<T> p)
?
I would prefer the first method because I suspect it to be faster. But is this really worth a though or are there any additional issues?
Edit: Could you please give the reasons for your choice or if the case, why you think that it does not matter.