[vtk-developers] vtkNew compile error

Brad King brad.king at kitware.com
Mon Feb 1 08:03:34 EST 2010


Bill Lorensen wrote:
> If I include another vtk file first, everything is fine. I though that
> vtkNew.h might need <ostream> but that didn't fix it.

Since the streaming operator uses 'ostream' and not 'std::ostream' it
is not enough to just include <ostream>.  Add

  #include "vtkIOStream.h"

to the header.  It does the "using std::ostream" for us.

Alternatively we could consider starting to use "std::" for streams
in our API.

> That said, my first couple of experiments with vtkNew() are very
> encouraging. The code is much lighter and readable.

Great!

-Brad



More information about the vtk-developers mailing list