I am writing a std::istream subclass, which uses its own std::stringbuf subclass
class decostream : public std::istream
{
public:
decostream(std::istream * input)
: std::istream(new decostreambuf(input))
{
}
~decostream() { delete rdbuf(); }
}
Is this valid? From std::istream documentation it is difficult to know if the streambuf must be still valid when the istream is destroyed.