Hello,
I'm currently writing a program in which I need to check wether a list is empty or not, though that produces me crush in the program when I operate the empty() function on it.
Project.h
class Project{
public:
friend class Map;
bool isProjectOpen;
list<Map> maps;
list<Map>::iterator it;
string Name;
Project();
};
public ref class MProject{
public:
Project * _p;
MProject();
};
Project.cpp
Project::Project(){
this->isProjectOpen = false;
}
#pragma managed
MProject::MProject(){
_p = new Project();
}
This is an unmanaged class used in a managed project, hence the wrapper.
if(!project._p->maps.empty())
This is the line the program crushes at(project is defined earlier in the code as Project project and from then until this line of code the maps variable is untouched completely), empty() is a function from Microsoft's list.h's list class.
I can't really give any more details, as I'm not even sure what the error means, as it's not a compiler error, but a run-time error.
If anyone could assist me with this, it would be most appreciated.