ANSI C++ changes revisited

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Thu Apr 27 14:16:38 EDT 2000


Hi,

ok I understand the support for old compilers is necessary (we do have
to do this here, but they all support - or ignore, the std namespace...)

But if you DO a "using std::ostream" in a headear file, one using
another "ostream" in is files (form another namespace) will have a
problem... so you will support the old compilers, but will cause
problems in the new ones.... :-)

Maybe the "typedef std::ostream vtkOstream" solution isn't so bad....

Or if we could us something like "#define std:: " it would be ok..
actually g++ simply "ignore" the std::, but I suppose they did a
workaround in the compiler itself...

Eric



Bill Hoffman wrote:
> 
> The problem is that we want to be able to support older compilers.
> If we change everything to be std::ostream, then VTK will stop working
> for several compilers.   The using allows the code to be the same for
> both ansi and non-ansi compilers.  It is not quite as bad as using std,
> as we are only brining in a few names from std.
> 
> At 11:46 AM 4/27/00 -0400, Eric Chamberland wrote:
> >Hi,
> >
> >just a not about the "using std::ostream"...  You should NOT do this if
> >it is in a header file, because any who include you header file will
> >have the "using std::ostream" effctive for his files...  So in all our
> >header files (and template files) we do simply write each method with
> >std::ostream instead of doing a "using std::ostream".
> >
> >so you woould probably want do to :
> >
> >PrintSelf(std::ostream...); // in your header file
> >
> >and in you source you could do:
> >using std::ostream;
> >PrintSelf(ostream...)
> >{
> >}
> >or
> >PrintSelf(std::ostream...)
> >
> >
> >Eric
> >
> >
> >

-- 
Eric Chamberland                   Eric.Chamberland at giref.ulaval.ca
2988 Pavillon Pouliot, GIREF       Tél.: (418) 656-2131 x6542
Université Laval, Canada, G1K 7P4  Fax : (418) 656-3404
--------------------------------------------------------------------
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