[vtk-developers] Handling invalid vtp files

Karthik Krishnan karthik.krishnan at kitware.com
Sun Feb 14 08:58:25 EST 2010


On Sat, Feb 13, 2010 at 6:18 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> to something like:
> template <class T>
> void vtkDataArrayTemplate<T>::GetTuple(vtkIdType i, double* tuple)
> {
>   T* t = this->Array + this->NumberOfComponents*i;
>   if(!t)
>     {
>     return;
>     }

You could change that to : assert(t != NULL)

I think the VTK community would okay assert's. They compile only when
_DEBUG is defined; ie no overhead in the release version. That said,
Berk is right, that in this case it doesn't provide very useful
information..

Mimicking some of boost's compile time and static assertion's might be
good for VTK, to enable bounds checking and traits validity even in
performance critical code.



More information about the vtk-developers mailing list