[Insight-developers] Compile time errors for umimplemented methods

Bill Lorensen bill.lorensen at gmail.com
Tue Jul 19 15:17:48 EDT 2011


You could define those required methods as pure virtual in the base
class. This would require an implementer to think about what to do in
the derived class.

Bill

On Tue, Jul 19, 2011 at 2:16 PM, Jeffrey Duda <jtduda at seas.upenn.edu> wrote:
> Hi,
> I've been working on some of the changes related to Transforms and was
> hoping for some guidance on how to best deal with umimplemented methods in
> derived classes. This is best described with an example:
> in the Transform base class we have two methods for transforming a vector:
> 1 - TransformVector( vector )
> 2 - TransformVector( vector, point )
> The second is needed for transforms that vary spatially (i.e. deformation
> fields). For linear transforms, the point is simply ignored since it is
> unnecessary, however since the point is required for a
> DeformationFieldTransform, the implementation of the first method currently
> throws an exception at run time. I was wondering if/how we could have this
> result in a compile-time error instead.
> -jeff
> _______________________________________________
> 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