作者suspect1 (嫌犯)
看板EE_DSnP
標題Re: [問題] 錯誤訊息
時間Fri Dec 15 00:13:03 2006
請問以下是什麼意思?
memTest.cpp:77: error: passing `const std::string' as `this' argument of
`std::b asic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>
::erase(typename _Alloc::size_type, typename _Alloc::size_type)
[with _CharT = c har, _Traits = std::char_traits<char>,
_Alloc = std::allocator<char>]' discards qualifiers
string option("-a 2 ") ;
size_t begin = option.find_first_not_of(' ',0) ;
size_t n = option.find_first_of(' ',begin);
option.erase(0,n) ; <- 發生錯誤的地方
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.4.242
推 ric2k1:"const" 被 discarded 掉了... 12/15 00:43