# std::istrstream::~istrstream

> C++ Atlas: `cppatlas.com/w/cpp/io/istrstream/~istrstream` | Source: https://en.cppreference.com/w/cpp/io/istrstream/~istrstream | Domain: Input/output | Standards: C++26

Destroys a std::istrstream object, which also destroys the member std::strstreambuf.

## Official Specification Summary (cppreference)

```cpp
virtual ~istrstream(); // (deprecated in C++98) (removed in C++26)
```

Destroys a `std::istrstream` object, which also destroys the member `std::strstreambuf`.

### Parameters

(none)

### Notes

The constructors of `std::istrstream` do not create the underlying `std::strstreambuf` in dynamically allocated mode, so the memory leaks that are possible with `std::ostrstream::~ostrstream` or `std::strstream::~strstream` do not apply.

### Example

```cpp
#include <iostream>
#include <strstream>

int main()
{
    {
        std::istrstream s("1.234");
        double d;
        s >> d;
        std::cout << d << '\n';
    } // destructor called
}
```

Output:

```text
1.234
```

---
Attribution: content from https://en.cppreference.com/w/cpp/io/istrstream/~istrstream (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.