Is the following code legal in c++17?
std::vector<int> x{1,2,3};
std::vector<int>::iterator it{};
bool result = x.begin() != it;
The following is quoted from https://en.cppreference.com/w/cpp/named_req/ForwardIterator :
Equality and inequality comparison is defined over all iterators for the same underlying sequence and the value initialized-iterators
If I understand this correctly, the comparison should be ok. And it seems to work on clang and gcc, but when I run this with MSVC 2019 in debug mode, I get an assert saying "vector iterators incompatible".
I'm not asking about the outcome of the comparison, I'm only interested if MSVC is conforming to the standard here.
Live example on godbolt