30 Jan
2014
30 Jan
'14
6:06 a.m.
On 30/01/2014 15:13, Quoth Ben Pope:
// invoke g with empty object g(shared_ptr<CSomeReallyLongClassName>());
g(0);
Note that (at least in Boost 1.53, haven't checked if this has been changed), .reset(0) is less efficient than .reset() because it still allocates a shared_count to the null pointer. I haven't checked if the constructor has the same issue but it wouldn't surprise me. (Also, the above doesn't compile in 1.53 because the raw pointer constructor is marked explicit. Again, maybe that's been changed in the interim.)