ENH: added OStringStream reset method (closes #534)

- resets the output buffer completely - implementing what rewind was
  likely meant to have accomplished for many use cases.

STYLE: OSHA1stream reset() for symmetry. Deprecate rewind().
This commit is contained in:
Mark Olesen
2017-07-17 18:32:42 +02:00
parent 86ef9e86dc
commit b4b50a3aa8
7 changed files with 47 additions and 15 deletions

View File

@ -52,9 +52,11 @@ int main(int argc, char *argv[])
Info<< "overwrite with short string:" << nl
<< os.str() << endl;
// os.reset();
// Info<< "after reset:" << nl
// << os.str() << endl;
os.reset();
os << "%%%% reset";
Info<< "after reset:" << nl
<< os.str() << endl;
Info<< "End\n" << endl;