Currently I am working in visual Studio 2008. Previously I was working in VS 2003 but I migrated the code VS2008.
I am getting below error in VS 2008 which was NOT in vS2003.
Error: _DEBUG_ERROR("vector iterators incompatible");
When i searched on the internet I found that it is due to strict type checking of vs2008.
Below is code snippet where I am getting run time error
First and foremost: Use CODE tags when posting code.
Second, I see little use in the comparison of two iterators from two different vectors. If you want to know if an object is contained in another vector, then the best way would be to overload the operator== and do the object comparison directly instead of trying to compare iterators.
@webJose :
I did overloading of == operator. Now i am geeting "vector iterator not dereferencable" at bold line(pCardLast=TAMCardPtr::DynamicCastEx(*_Last))
it seems that the _Last is not coming properly(means empty..null ??).
But the the value of _Last is taken from end() of collection.
How it could be failing?
Can you suggest any alternative way of doing same thig?