ANSI C++ changes revisited

Bill Hoffman bill.hoffman at kitware.com
Thu Apr 27 15:12:41 EDT 2000


It has to be in a .h file.

The PrintSelf methods look like this:

   void PrintSelf(ostream& os, vtkIndent indent);

Also, many VTK functions that manipulate ostream are defined
in .h files (inlines).   So we can not just forward reference
the ostreams.   

You have code that has endl as a function???
That sounds like it would only work with a newer compiler as it would
conflict with the old iostream.h.  I assume that your endl
is in another namespace. 


At 02:58 PM 4/27/00 -0400, Eric Chamberland wrote:
>Hey!
>
>I do have problem with polution the global scope...
>
>By the way, wouldn't you simply need a forward declaration in your
>header files?  The you could do something like:
>
>#ifndef NO_STD_COMPILER
>#include <iosfwd>
>#else
>class ostream;
>class istream;
>...
>#endif
>
>Or you could to this in a vtk header file (vtkiosfwd.h).
>
>For template files... you still have the problem...
>
>If you want to do your "using std::*" in a source file, I don't mind,
>but in a header file... we will have problem (since we use some
>functions with the same name... like "endl"...).
>
>Eric
>

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list