[vtkusers] Forward declaration of Foo enough for vtkNew<Foo> declaration?

Elvis Stansvik elvis.stansvik at orexplore.com
Wed Aug 10 08:32:06 EDT 2016


Hi,

The overview at

    https://blog.kitware.com/a-tour-of-vtk-pointer-classes/

seems to suggest that forward declaration of a class Foo should be enough
to be able to declare a vtkNew<Foo> (e.g. see how vtkTable is used in the
code example under "Use of Classes").

But when I try e.g:

class vtkCompositeTransferFunctionItem;
...
vtkNew<vtkCompositeTransferFunctionItem> m_functionsItem;

I get

    error: invalid use of incomplete type ‘class
vtkCompositeTransferFunctionItem’

Do I really need to include vtkCompositeTransferFunctionItem.h to declare a
vtkNew<vtkCompositeTransferFunctionItem> ?

Thanks,
Elvis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160810/4ff225e7/attachment.html>


More information about the vtkusers mailing list