[Insight-developers] Returning a smart pointer or a pointer?

Bill Lorensen bill.lorensen at gmail.com
Mon May 19 13:05:57 EDT 2008


Tom,

Unfortunately, I don't think we can predict what are users have done
with the original API that we . We still need to protect their
investment.

How much of a performance hit are you seeing?

Maybe we will have to define a new method? Are their other classes
that have the same p[problem?

Bill

On Mon, May 19, 2008 at 12:09 PM, Tom Vercauteren
<tom.vercauteren at gmail.com> wrote:
> Hi all,
>
> Since I am not sure to fully understand ITK's policy regarding the use
> of smart pointers versus pointers, I would appreciate any feedback on
> the following question:
> Why does itk::PDEDeformableRegistrationFunction::GetDeformationField
> returns a smart pointer and not a pointer and can we change that?
>
>
> The reason I am asking is because I realized that returning a smart
> pointer was affecting the performance of my application. Changing the
> return type to a usual pointer led to a measurable speedup.
>
> Since most other functions return a usual pointer it seems like
> itk::PDEDeformableRegistrationFunction::GetDeformationField should
> also return a pointer. If we change the return type, some users may
> run into backwards compatibility issues (e.g. a class inherits from
> PDEDeformableRegistrationFunction but redefines GetDeformationField).
> This seems unlikely though...
>
>
> Thanks,
> Tom
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list