Why is the gptr type basic_streambuf char_type * and not const char_type *?

The item basic_streambufto install the three "gptrs" streambuf,, setgis declared as:

protected:
  void setg(char_type *gback, char_type *gptr, char_type *egptr);

I am wondering: why did the type of each gptr do char_type*instead const char_type*? Can const_castanyone use const char pointers for these gptrs to use here?

+3
source share
1 answer

const, streambuf , . , underflow uflow n streambuf. /. Streambuf - , , . [io]stream ( ). , ( , , , const).

? . streambuf , .

+5

Source: https://habr.com/ru/post/1778635/


All Articles