[vtkusers] vtkStdString vs vtkstd::string

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Jan 14 10:50:42 EST 2010


On Thu, Jan 14, 2010 at 3:09 PM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
> 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.

API are not compatible. So I doubt you can replace vtkStdString with a
vtkstd::string. I would rather vtkstd:: be removed and vtksys
replacement be used (using namespace aliasing).

2cts
-- 
Mathieu



More information about the vtkusers mailing list