Я пробовал while (!config.empty()) и удалил front() после использования это. до сих пор не понимаю, где что-то пошло не так.
Код: Выделить всё
std::list config;
Код: Выделить всё
config[0]:
int testnumber = 1;
string testname = "Test1"
config[1]:
int testnumber = 2;
string testname = "Test2";
config[2];
int testnumber = 3;
string testname = "Test3";
---------------------------------------------------------------------
Logic* pLogic;
Object* pObject = config.front(); // config[0]
if (pObject) // while(!config.empty()) -- tried here
{
// do something
pLogic = new Logic(pObject);
config.pop_front();
}
Код: Выделить всё
Object* m_pObject;
Logic::Logic(Object* pObject)
:m_pObject(pObject)
{}
// Accessed config in other functions with m_pObject
Код: Выделить всё
ERROR: Debug assertion failed
Expression:cannot dereference end list iteratorПодробнее здесь: https://stackoverflow.com/questions/562 ... t-iterator
Мобильная версия