I'm trying to implement a input_seekable source with boost iostreams. The source uses fixed data from a char array. The reading works so far but I'm having a problem with the seek function.
The documentation https://www.boost.org/doc/libs/1_75_0/libs/iostreams/doc/index.html shows an example for a container device where the seek function is implemented. Lets say I need to construct an istream from a streambuffer with the implemented source and I use seekg(0, std::ios_base::end) to get to the end of the stream to use tellg() for the stream size.
What is the intended behavior of tellg()? As is understand it seekg(0, std::ios_base::end) will put the read pointer one past the last element in the buffer so tellg will return the number of bytes in the stream. The implementation the documentation points to the last element which would lead to tellg reporting the wrong number of bytes.