[vtkusers] vtkStdString vs vtkstd::string

Jeff Baumes jeff.baumes at kitware.com
Thu Jan 14 09:09:13 EST 2010


On Wed, Jan 13, 2010 at 7:15 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> The doc for vtkStdString says:
>
> Wrapper around vtkstd::string to keep symbols short.
> vtkStdString derives from vtkstd::string to provide shorter symbol
> names than basic_string<...> in namespace std given by the standard
> STL string.
>
> But I guess I don't understand what that means. When should one use
> vtkStdString vs vtkstd::string?

I don't know the answer to your question, but it would be nice if all
these pointed to the same underlying thing: std::string. I'm assuming
the older compilers are responsible for the need for short symbols.
Perhaps the compiler deprecation that Berk sent recently will allow us
to eventually replace all vtkStdString and vtkstd::string with
std::string?

We are thinking to maybe start testing the use of std::string in the
examples first.

Longer term, we could do something like the following:

typedef std::string vtkStdString;
#define vtkstd std

So the old type names could still be used, but we could in time
replace all occurrences in VTK to just use std::string. Eventually the
old aliases could be removed.

But there could be unforeseen issues with this idea that force us to
continue using vtkStdString/vtkstd::string.

Jeff



More information about the vtkusers mailing list