[Insight-developers] SmartPointer null check

Matt McCormick matt.mccormick at kitware.com
Wed Oct 19 14:06:24 EDT 2011


Hi Miklos,

In my humble opinion, it would be too much of a computational burden,
and it usually indicates a logic bug in the code, not something a GUI
user would create.

Thanks,
Matt

On Wed, Oct 19, 2011 at 1:57 PM, Miklos Espak <espakm at gmail.com> wrote:
> Hi,
> would it be possible to make a NULL check in itk::SmartPointer::operator->
> and operator* ?
> I thought an std::runtime_error (or derivant) could be thrown if m_Pointer
> is 0. In this way the application would not crash on null pointer
> dereference but it could be caught from a GUI eventually. That could spare a
> lot of null checks in the code.
> Sorry, if this is a recurring topic of discussion or it is already
> implemented in ITK 4.0. I use 3.20.0 as part of MITK.
> Best regards,
> Miklos Espak
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>


More information about the Insight-developers mailing list