[Insight-developers] testing SmartPointer for "null"

Bill Hoffman bill.hoffman at kitware.com
Wed Sep 13 15:11:57 EDT 2000


The best thing to do is this:

if (!p)


At 02:46 PM 9/13/00 -0400, Luis Ibanez wrote:
>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
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers 





More information about the Insight-developers mailing list