$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] boost::none for boost::shared_ptr
From: Chris Stankevitz (chrisstankevitz_at_[hidden])
Date: 2014-01-29 12:27:47
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>());