C
Chameleon
All these happen in VC++ NET 2003, if you ask me about the compiler.
it._Myptr is a VC++ specific member of the iterator implementation.
But from this, we extract usefull informations about crash.
----------------------------
vector<int*> v;
vector<int*>::iterator it = v.begin(); // it._Myptr == 0 (what pointer
is this?)
v.insert(it, 5); // works
it++; // it._Myptr == 4
v.insert(it, 5); // crashes
----------------------------
and this.
----------------------------
vector<int*> v;
vector<int*>::iterator it = v.begin(); // it._Myptr == 0
v.push_back(5);
vector<int*>::iterator it = v.begin(); // it._Myptr == 0x00323b40 (the
pointer to first element)
----------------------------
All of these are compiler bugs on iterator implementation, or I miss
something?
Thanks
it._Myptr is a VC++ specific member of the iterator implementation.
But from this, we extract usefull informations about crash.
----------------------------
vector<int*> v;
vector<int*>::iterator it = v.begin(); // it._Myptr == 0 (what pointer
is this?)
v.insert(it, 5); // works
it++; // it._Myptr == 4
v.insert(it, 5); // crashes
----------------------------
and this.
----------------------------
vector<int*> v;
vector<int*>::iterator it = v.begin(); // it._Myptr == 0
v.push_back(5);
vector<int*>::iterator it = v.begin(); // it._Myptr == 0x00323b40 (the
pointer to first element)
----------------------------
All of these are compiler bugs on iterator implementation, or I miss
something?
Thanks