bleair
02-22-2008, 03:10 PM
I would like to use the evaluate tool to iterate through one of my stl
containers. The documentation for the evaluate tool only shows simple examples
where arrays and simple integer iterators are used.
Is it possible to iterate through an stl container? Is it even possible to declare an STL iterator type variable in the evaluate expression box?
For example, let's say I have the following program code:
class MyClass {
public:
bool m_flag;
};
std::deque <MyClass> g_mySet;
Now, I'd like to evaluate a little expression snippet that iterates
through mySet.
--------------------------
int numberSet;
std::deque <MyClass>::iterator myiter;
numberSet = 0;
for (myiter = g_mySet.begin (); myiter != g_mySet.end (); myiter++)
{
if ((*myiter).m_flag)
numberSet++;
}
numberSet++;
I get errors when I try to do this, but I may not be using the correct magic
syntax needed for the Evaluate Expression window. Is this possible?
containers. The documentation for the evaluate tool only shows simple examples
where arrays and simple integer iterators are used.
Is it possible to iterate through an stl container? Is it even possible to declare an STL iterator type variable in the evaluate expression box?
For example, let's say I have the following program code:
class MyClass {
public:
bool m_flag;
};
std::deque <MyClass> g_mySet;
Now, I'd like to evaluate a little expression snippet that iterates
through mySet.
--------------------------
int numberSet;
std::deque <MyClass>::iterator myiter;
numberSet = 0;
for (myiter = g_mySet.begin (); myiter != g_mySet.end (); myiter++)
{
if ((*myiter).m_flag)
numberSet++;
}
numberSet++;
I get errors when I try to do this, but I may not be using the correct magic
syntax needed for the Evaluate Expression window. Is this possible?