std::istrst...~istrstream(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

okay bestie, welcome to the std::istrst...~istrstream(3) page from the C++ Standard Libary πŸ’… this one is all about the destructor, and it's lowkey iconic.

std::istrstream::~istrstream - std::istrstream::~istrstream

✨ Synopsis ✨

virtual ~istrstream();

so yeah, it's virtual ✨ and here's the timeline tea: deprecated in C++98, removed in C++26 😭. It destroys a std::istrstream object, which also destroys the member std::strstreambuf. periodt.

πŸŽ€ Parameters πŸŽ€

(none) β€” literally no parameters, bestie. zero. nada. 🫢

πŸ¦‹ Notes πŸ¦‹

okay so the notes are giving β€œdon't panic about leaks” energy: 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. slay for safety, no cap ✨

πŸ’– 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

and that's the tea πŸ“ this page came from http://cppreference.com, dated/versioned 2024.06.10, and it's the std::istrst...~istrstream(3) manual page. mwah πŸ’‹

πŸ“¦ where this page comes from