Its not a global problem with operator [], I have just checked, and VA is working correctly for three different test classes that overload this operator, including CArray.
More than that, I am seeing NO problems with the following code:
#include <deque>
#include <vector>
struct simplestruct
{
int IntMember;
long LongMember;
};
static void testUnderliningAfterStdItem()
{
std::deque<simplestruct> queue;
std::vector<simplestruct> vect;
simplestruct item;
queue.push_back(item);
vect.push_back(item);
queue[0].IntMember = 100;
vect[0].LongMember = 1000L;
int n = queue[0].IntMember;
long l = vect[0].LongMember;
}
yet I am seeing a problem with the code:
#include <deque>
struct simpleStructDeque
{
int nIntMember;
long nLongMember;
};
static void testUsingDeque()
{
std::deque<simpleStructDeque> listFoo;
simpleStructDeque stItem;
listFoo.push_back(stItem);
listFoo[0].nIntMember = 10; // underlining here
};
I do not see what is triggering this problem. Most odd.