| ||||
| Comment on GotW #91 Solution: Smart Pointer Parameters by Emmanuel Thivierge
Hi everybody, I had created a std:vector and I was going to pass it to a function std:vector widgetList; To me addWidgetList is a sink, the object will take the ownership of the vector. So I tough, I should pass a std:unique_ptr<std::vector>, first it start to be a mouthful to write and my object is actually on the stack. In this guru you don’t only talk about smart pointers but also on when/how to pass argument to functions. To me this situation is like c) the function is a sink but for the stack i would express it as std::vector&&. Would that be a good practice? | ||||
| ||||
Wednesday, July 3, 2013
FeedaMail: Comments for Sutterâs Mill
Subscribe to:
Comments (Atom)