-
- Downloads
vtkOStreamWrapper: Support std::string
This will allow std::string to be used with vtkSet/Get macros. See discussion thread VTK coding conventions clarification http://www.vtk.org/pipermail/vtk-developers/2014-March/014867.html It is not possible to portably forward-declare std::string or the std::basic_string<> template, but we do not want to include <string>. Instead, use a template that happens to match std::basic_string<> and forwards to a private implementation (where <string> and <iostream> are available) by casting through an internal concrete type. Use std::char_traits<> and std::allocator<> declarations that we know vtkSystemIncludes.h brought in before including the vtkOStreamWrapper.h header. Add a new "TestOStreamWrapper" test case to cover use of the vtkOStreamWrapper with std::string in a translation unit that acts like wrapper-generated sources (define VTK_STREAMS_FWD_ONLY) where no <iostream> is included. Suggested-by:David C. Lonie <david.lonie@kitware.com> Change-Id: I5bf4803b0e4b1e7c899b061fdbd6f66f08cbc7d6
Showing
- Common/Core/Testing/Cxx/CMakeLists.txt 1 addition, 0 deletionsCommon/Core/Testing/Cxx/CMakeLists.txt
- Common/Core/Testing/Cxx/TestOStreamWrapper.cxx 38 additions, 0 deletionsCommon/Core/Testing/Cxx/TestOStreamWrapper.cxx
- Common/Core/vtkOStreamWrapper.cxx 9 additions, 0 deletionsCommon/Core/vtkOStreamWrapper.cxx
- Common/Core/vtkOStreamWrapper.h 10 additions, 0 deletionsCommon/Core/vtkOStreamWrapper.h
Please register or sign in to comment