I have been struggling to debug a large code using std::list extensively. It seems that objects in a list are not accessible in the debugger using Creator if they contain a static member. I tried various version including the latest 4.3.0.
I managed to distil the problem to the below example. As shown in the attached image, objects of Test1 are labelled <not accessible>, whilst Test2 are fine inside the list. Objects outside of the list are accessible independently from having a static member or not.
Any help would be greatly appreciated.
#include <iostream>
#include <list>
class Test1
{
public:
static const int NOPOS=-1;
int a;
};
class Test2
{
public:
const int NOPOS=-1;
int a;
};
int main()
{
std::list<Test1> list1;
Test1 t11;
list1.push_back(t11);
Test1 t12;
list1.push_back(t12);
std::list<Test2> list2;
Test2 t21;
list2.push_back(t21);
Test2 t22;
list2.push_back(t22);
return 0;
}
#include <iostream>
#include <list>
class Test1
{
public:
static const int NOPOS=-1;
int a;
};
class Test2
{
public:
const int NOPOS=-1;
int a;
};
int main()
{
std::list<Test1> list1;
Test1 t11;
list1.push_back(t11);
Test1 t12;
list1.push_back(t12);
std::list<Test2> list2;
Test2 t21;
list2.push_back(t21);
Test2 t22;
list2.push_back(t22);
return 0;
}
To copy to clipboard, switch view to plain text mode
debug.jpg
Bookmarks