std::istrstream::~istrstream - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::istrstream::~istrstream

From cppreference.com
< cpp‎ | io‎ | istrstream

virtual ~istrstream(); |  |

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

### [edit] Parameters

(none)

### [edit] 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.

### [edit] Example

Run this code

    #include <strstream>
    #include <iostream>

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

Output:

    1.234

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/io/istrstream/%7Eistrstream&oldid=65184"