[Insight-developers] testing SmartPointer for "null"

Luis Ibanez ibanez at cs.unc.edu
Wed Sep 13 14:46:59 EDT 2000


Hi,

What's the right way of testing if a
SmartPointer have been assigned ?

My current test is to check the normal
pointer returned by "GetPointer()" like

itk::Image<double,3>::Pointer p;
if(    p->GetPointer()    )
{
... // assume it is valid...
}

Is this correct ?



Thanks

Luis




More information about the Insight-developers mailing list