【发布时间】:2010-12-05 23:19:17
【问题描述】:
设置streambuf的三个“gptrs”的basic_streambuf成员setg声明为:
protected:
void setg(char_type *gback, char_type *gptr, char_type *egptr);
我想知道:为什么每个 gptr 的类型都是 char_type* 而不是 const char_type*?在这里使用const_cast 为这些 gptrs 使用 const char 指针是否安全?
【问题讨论】:
标签: c++ iostream const-correctness streambuf