错误信息如题所示。
修改前:
1 template< 2 typename _CharT, 3 typename _Traits = std::char_traits<_CharT> 4 > 5 class BasicStkIos 6 : virtual public std::basic_ios<_CharT, _Traits> 7 { 8 public: 9 typedef basic_stkbuf <_CharT,_Traits> StkBufType; 10 11 BasicStkIos() 12 : mBuf() 13 {init(&mBuf) ;}; 14 15 BasicStkIos(const char* fName, std::ios::openmode m, const char* pFilter) 16 : mBuf(fName, m, pFilter) 17 { init(&mBuf) ; } 18 19 StkBufType* 20 rdbuf() 21 { return &mBuf; } 22 23 protected: 24 StkBufType mBuf; 25 };
修改后:
1 template< 2 typename _CharT, 3 typename _Traits = std::char_traits<_CharT> 4 > 5 class BasicStkIos 6 : virtual public std::basic_ios<_CharT, _Traits> 7 { 8 public: 9 typedef basic_stkbuf <_CharT,_Traits> StkBufType; 10 11 BasicStkIos() 12 : mBuf() 13 {this->init(&mBuf) ;}; 14 15 BasicStkIos(const char* fName, std::ios::openmode m, const char* pFilter) 16 : mBuf(fName, m, pFilter) 17 { init(&mBuf) ; } 18 19 StkBufType* 20 rdbuf() 21 { return &mBuf; } 22 23 protected: 24 StkBufType mBuf; 25 };