30 Jan
2014
30 Jan
'14
2:13 a.m.
On 30/01/14 01:27, Chris Stankevitz wrote:
Hello,
Does boost::shared_ptr offer a way to create an empty shared pointer without a lot of typing? Perhaps something analogous to boost::none. I am not using c++11.
Thank you,
Chris
==
using boost::none; using boost::optional;
// declare f(optional<CSomeReallyLongClassName> Item); g(shared_ptr<CSomeReallyLongClassName> pItem);
// invoke f with empty object f(none);
// invoke g with empty object g(shared_ptr<CSomeReallyLongClassName>());
g(0); Ben