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

Elvis Stansvik elvis.stansvik at orexplore.com
Wed Aug 10 10:50:26 EDT 2016


2016-08-10 15:43 GMT+02:00 David Lonie <david.lonie at kitware.com>:

> 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
> headers.
>
> 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?
>

Sorry for the terse error message, I should have pasted more.

But it looks like Shawn has guessed what my problem was.

Thanks to both of you.

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


More information about the vtkusers mailing list