# error: incomplete type 'vtkOStreamWrapper::std\_string' used in type trait expression

**URL:** https://discourse.vtk.org/t/error-incomplete-type-vtkostreamwrapper-std-string-used-in-type-trait-expression/10639
**Category:** Support
**Created:** [February 7, 2023, 9:11pm UTC](https://discourse.vtk.org/t/error-incomplete-type-vtkostreamwrapper-std-string-used-in-type-trait-expression/10639 "2023-02-07T21:11:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![qi\_li](https://discourse.vtk.org/user_avatar/discourse.vtk.org/qi_li/32/6515_2.png) [@qi\_li](https://discourse.vtk.org/u/qi_li)
#### Post date: [February 7, 2023, 9:11pm UTC](https://discourse.vtk.org/t/error-incomplete-type-vtkostreamwrapper-std-string-used-in-type-trait-expression/10639/1 "2023-02-07T21:11:58Z")

</div>

Hello, did anyone knows where is the definition of the forward declaration class std\_string in tkOStreamWrapper.h. Then I can include this file to make the std\_string complete. I have searched all the head files, didn’t fined any content relate to std\_string. There is a file vtkStdString.h, but it’s not the std\_string.

could anyone help me out.

Thank you very much.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [February 8, 2023, 1:48am UTC](https://discourse.vtk.org/t/error-incomplete-type-vtkostreamwrapper-std-string-used-in-type-trait-expression/10639/2 "2023-02-08T01:48:53Z")

</div>

So can you show us exactly what error you saw that was related to it?

As far as I understand, `std_string` is not intended to have a definition. It’s private, and only used as an opaque reference.

See this code in `vtkOStreamWrapper.h`:

```cpp
  // Accept std::string without a declaration.
  template <template <typename, typename, typename> class S>
  vtkOStreamWrapper& operator<<(const S<char, std::char_traits<char>, std::allocator<char>>& s)
  {
    return *this << reinterpret_cast<std_string const&>(s);
  }

```

And see this code in `vtkOStreamWrapper.cxx`:

```cpp
vtkOStreamWrapper& vtkOStreamWrapper::operator<<(std_string const& s)
{
  this->ostr << reinterpret_cast<std::string const&>(s);
  return *this;
}

```

As you can see, `std_string` is only used by reference, and it needs no definition. It’s just used with a bit of template magic to allow `operator<<` to work with `std::string`, without requiring `vtkOStreamWrapper.h` to do `#include <string>`.

The code has been this way (intentionally) for many years.
