KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When a function takes a shared_ptr (from boost or C++11 STL), are you passing it: by const reference: void foo(const shared_ptr<T>& p) or by value: void foo(shared_ptr<T> p) ? I would prefer the first method because I suspect it would be faster. But is this really worth it or are there any additional issues? Could you please give the reasons for your choice or if the case, why you think it does not matter.
Tags (comma-separated)
Save Edits
Cancel