From cppreference.com
voidinit_buf_ptrs();(exposition only*)Initializes the input and output sequences from buf according to mode. buf and mode are
of *this.
Immediately after this function returns:
If
is set in mode,
points to buf.front() and epptr()>=pbase()+buf.size() is true; in addition, if
is set in mode, pptr()==pbase()+buf.size() is true,
otherwise pptr()==pbase() is true.
If
is set in mode,
points to buf.front(), and gptr()==eback()&&egptr()==eback()+buf.size() is true.
Notes
For efficiency reasons, stream buffer operations can violate invariants of buf while it is held encapsulated in the std::basic_stringbuf, e.g., by writing to characters in the range [buf.data()+buf.size(), buf.data()+buf.capacity()).
All operations retrieving a
from buf ensure that the
invariants hold on the returned value.
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
C++98 calling init_buf_ptrs() made
pptr()==pbase()+buf.data()
for streams that are both input and output streams makes
pptr()==pbase()+buf.size()
for append streams