dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #21167
Re: Checking if shared_ptr is NULL
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;
}
or just or implement a constructor for Hierarchical which initialize the
shared_ptr to 0?
Johan
> The following seems to return true for a pointer that hasn't been
> initialized:
>
> bool has_child() const
> {
> return _child != 0;
> }
>
> (in Hierarchical.h)
>
> --
> Anders
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help : https://help.launchpad.net/ListHelp
Follow ups
References