istream::tellg() returns -1 when used with my custom streambuf class?

♀尐吖头ヾ 提交于 2019-12-05 09:09:34
Bo Persson

The functions tellg and seekg depends on protected virtual functions seekoff and seekpos, that you would have to implement in your membuf class.

The defaults in basic_streambuf just returns pos_type(off_type(-1)) for all calls (which might be equal to -1 for many implementaions).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!