[Insight-developers] Is it ok to return values in function params?

Luis Ibanez luis.ibanez at kitware.com
Thu Feb 10 17:10:03 EST 2011


Michael

We do that in several instances,

For example

Image::TransformPhysicalPointToIndex( inputPoint, outputIndex );
Image::TransformIndexToPhysicalPoint( inputIndex, outputPoint );

Usually returned by reference.

     Luis


-------------------------------
On Thu, Feb 10, 2011 at 2:25 PM, M Stauffer (V) <mstauff at verizon.net> wrote:
> Hi,
>
> Is it accepted in ITK style to return values in function parameters? I'd
> like to return a functor result by value, but using a class member to
> hold the result for return-by-value means it won't be thread-safe. I
> could make multiple copies of the functor when used in a threaded
> context, but that means the class is harder to use properly. If I use a
> function parameter to return the result, it would be thread-safe.
>
> Cheers,
> Michael
>
> _______________________________________________
> 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