Vadim(*), for the question posed in that thread, I think that the definition ought to be that the handle remains owned by the object from which it came. Only during the lifetime should it be valid. Users would have to duplicate the handle if they need one they own. I suppose that there could be a way to destroy/deactivate the object and return the handle into the caller's possession, like a move constructor and the thread thing.
(*) I hope I read your Cyrillic name correctly...sorry if not.
But what to do about environments like Windows NT, where there are two layers of file handles? Even fileno and fdopen are not standardized.
Melissa
Yes, I agree that it's important to be able to make a stream object from a native handle type.But what to do about environments like Windows NT, where there are two layers of file handles? Even fileno and fdopen are not standardized.
The C++ stream equivalent of fopencookie is std::iostream itself. Just derive
from istream or ostream.
I think this would make writing C++ that interacts with POSIX (or Win32)
code a fair bit easier. If this sounds reasonable to others, I can work
on a proposal for it.