Fixed: C++ - passing references to std::shared_ptr or boost::shared_ptr #it #answer #dev
Fixed: C++ – passing references to std::shared_ptr or boost::shared_ptr #it #answer #dev
C++ – passing references to std::shared_ptr or boost::shared_ptr
If I have a function that needs to work with a shared_ptr, wouldn’t it be more efficient to pass it a reference to it (so to avoid copying the shared_ptr object)? What are the possible bad side effects? I envision two possible cases:
1) inside the function a copy is made of the argument, like in
ClassA::take_copy_of_sp(boost::share…
View On WordPress











