On Tue, Feb 01, 2011 at 01:36:59PM -0800, Johan Hake wrote:
> On Tuesday February 1 2011 13:18:54 Anders Logg wrote:
> > What is the correct way to check whether a shared_ptr is NULL?
>
> What with:
>
>  bool has_child() const
>  {
>    return _child.count()!=0;
>  }

Will try that.

> or just or implement a constructor for Hierarchical which initialize the
> shared_ptr to 0?

I was under the impression it's always initialized to 0, and
initialization to zero should be handled by

_foo = shared_ptr<foo>();

--
Anders

_______________________________________________
Mailing list: https://launchpad.net/~dolfin
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp

Reply via email to