I would say that this will lead to undefined behavior.
According to http://cppreference.com , vector::vector(first, last) accepts an input iterator, and, with regard to iteration, this category of iterators is only required to provide operator!= And operator++ .
The vector constructor will basically run a loop equivalent to:
while (first != last) { push_back(*first); ++first; }
This will cause an infinite loop, but can be protected by the implementation of the standard library with some statement (at least in debug builds).
source share