i think, In the "if (which & ios_base :: out)" part in the seekoff function of basic_stringbuf, the part that is ielement is a mistake of oelement.