VS2005 SP1のデバッグ構成でコンパイルされた以下のコードは、「ITERATORLISTCORRUPTED」通知を含む2つのメッセージを示しています。
コードスニペット
#define _SECURE_SCL 0
#define _HAS_ITERATOR_DEBUGGING 0
#include <sstream>
#include <string>
int main()
{
std::stringstream stream;
stream << "123" << std::endl;
std::string str = stream.str();
std::string::const_iterator itFirst = str.begin();
int position = str.find('2');
std::string::const_iterator itSecond = itFirst + position;
std::string tempStr(itFirst,itSecond); ///< errors are here
return 0;
}
コンパイラまたは標準ライブラリのバグですか?