[vtk-developers] Casting vtkIntArray vs vtkIdTypeArray

Bill Lorensen bill.lorensen at gmail.com
Sat Sep 18 18:20:45 EDT 2010


David,

Why are we using SafeDownCast rather than c++'s dynamic_cast?

Bill

On Sat, Sep 18, 2010 at 1:44 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Just to make it clear to everyone on the list about SafeDownCast:
>
> SafeDownCast() allows or disallows casts based on the hierarchy and
> nothing else.
>
> It refuses to cast a "vtkIdTypeArray *" to a "vtkIntArray *" is
> because vtkIntArray is not a subclass of vtkIdTypeArray.  Also, as I
> said before, it does not "convert" anything.  It merely reinterprets
> one object pointer type as a different object pointer type.
>
>  David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list