My problem is as follows: Martin York claims in this, this, and this answers that one can make a stringstream read from some piece of memory by using basi
I believe it is implementation defined and that you provided the relevant quotes.
For the record, this is what Standard C++ IOStreams and locales, not exactly a recent book I have to admit, has to say on the subject in a section titled "The almost semantic free function - setbuf()" :
The virtual member function
setbuf()is a rather peculiar stream buffer member. Its semantics are basically undefined. For string stream buffers, the semantics ofsetbuf()are implementation-defined, except thatsetbuf(0, 0)are defined: ifsetbuf(0, 0)is called on a stream before and I/O has occured on that stream, the stream becomes unbuffered, meaning that characters are directly transported to and from the file system. Otherwise, the results are implementation-defined.However, the specifications of
setbuf()forbasic_filebufandbasic_stringbufhardly impose any requirements on the semantics ofsetbuf()in other stream buffer types. At best, the general semantics can be defined as device and, in the case of user-defined stream buffer types, implementation-specific.The lack of any requirements frees you to redefine
setbuf()for just about any purpose and in any way that fits into the predefined interface ofsetbuf().