std::istrstream::~istrstream
From cppreference.com
< cpp | io | istrstream
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Input/output library
Print functions (C++23)
Buffers
(C++23)
(C++98/26*)
(C++20)
Streams
Abstractions
File I/O
String I/O
Array I/O
(C++23)
(C++23)
(C++23)
(C++98/26*)
(C++98/26*)
(C++98/26*)
Synchronized Output
(C++20)
Types
Error category interface
(C++11)
(C++11)
virtual ~istrstream();
(deprecated in C++98) (removed in C++26)
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 <iostream> #include <strstream> int main() { { std::istrstream s("1.234"); double d; s >> d; std::cout << d << '\n'; } // destructor called }
Output:
1.234