I have a class with a std::vector data member e.g.
class foo{ public: const std::vector getVec(){return myVec;} //other stuff omitted private: s
Another cause of the MSVC STL debug assertion "vector iterators incompatible" is operating on an invalidated iterator.
I.e. v.erase(i), and then compare i != v.end() the erase invalidates i and so it cannot be used in a comparison.
v.erase(i)
i != v.end()
i