cpp/io/basic filebuf/seekoff

Repositions the file pointer, if possible, to the position that corresponds to exactly characters from beginning, end, or current position of the file (depending on the value of ).

If the associated file is not open, fails immediately.

If the multibyte character encoding is state-dependent ( returned ) or variable-length ( returned ) and the offset is not, fails immediately: this function cannot determine the number of bytes that correspond to  characters.

If is not std or the offset  is not, and the most recent operation done on this filebuf object was output (that is, either the put buffer is not empty, or the most recently called function was overflow), then calls  to determine the unshift sequence necessary, and writes that sequence to the file by calling overflow.

Then converts the argument to a value  of type  as follows:

Then, if the character encoding is fixed-width ( returns some positive number ), moves the file pointer as if by.

Otherwise, moves the file pointer as if by.

The argument, required by the base class function signature, is usually ignored, because  maintains only one file position.

Return value
A newly constructed object of type which stores the resulting file position, or  on failure.