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

David Lonie david.lonie at kitware.com
Wed Aug 10 09:43:22 EDT 2016

On Wed, Aug 10, 2016 at 8:39 AM, Elvis Stansvik
<elvis.stansvik at orexplore.com> wrote:
> 2016-08-10 14:32 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
>> 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").

This is correct. The vtkNew template does not require its parameter's
header to be included and forward declaration is sufficient. Look
through the VTK code and you'll see this pattern used in a lot of

What is the full error (with file path, line number, etc)? I wonder if
the moc'd header that Qt generates is trying to do something funky
here. Which line is it complaining about?

More information about the vtkusers mailing list