Parameters

pos

New absolute position for the position pointer.
Member type pos_type is determined by the character traits: generally, it is an fpos type (such as streampos) that can be converted to/from integral types.

which

Determines which of the position pointers is affected: the get pointer, the put pointer, or both. It is an object of type ios_base::openmode that, for this function, may take any combination of the following significant constant values:

Return Value

On success, it returns pos.
On failure, the function returns pos_type(off_type(-1)).
Member type pos_type is determined by the character traits: generally, it is an fpos type (such as streampos) that can be converted to/from integral types.

Data races

Modifies the basic_stringbuf object.
Concurrent access to the same object may cause data races.

Exception safety

Basic guarantee: if an exception is thrown, the object is in a valid state.