The basic_streambuf
member to set the three "gptrs" of the streambuf, setg
, is declared as:
protected:
void setg(char_type *gback, char_type *gptr, char_type *egptr);
I am wondering: why was the type of each gptr made char_type*
instead of const char_type*
? Is it safe to use const_cast
here to use const char pointers for these gptrs?