[vtk-developers] Use of std:: in vtk

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 14 16:16:18 EST 2009


Folks,

Coming from the itk world, we always use std::cout and std:: for
string, vector, map, etc. In trying to check in some new examples, my
pre-commit failed with the message:

GenerateCubesFromLabels.cxx has used the std:: or vtkstd:: to access streams.
For example, std::cout or vtkstd::endl.
For VTK, you must not use a namespace for streams.
Common/vtkIOStream.h for list of using directives in VTK.

I'm sure there used to be a good reason for this in the old days, but
is this restriction still necessary? Also, to use std::string I needed
to change it to vtkstd::string. It makes one wonder how std::string
differs from vtkstd::string.

I did change std::cout to cout, but this is in conflict with itk and
probably other styles.For instance, I noticed that CMake source code
uses std::string, vector, map etc.

I did check in the examples with the required commit check suggestions.

Bill



More information about the vtk-developers mailing list