Consider:void fn(const std::vector<std::wstring>& v){ for (auto it = v.begin(), e = v.end(); it != e; ++it) { }}This simple snippet works and does what it should: iterate over all elements of the vector.Now change it so that it skips the first element:void fn(const std::vector<std::wstring>& v){ for (auto it = v.begin() + 1, e = v.end(); it != e; ++it) { }}and the compiler issues an error:1> error C3538: in a declarator-list 'auto' must always deduce to the same type1> could be 'std::_Vector_const_iterator<_Myvec>'1> with1> [1> _Myvec=std::_Vector_val<std::wstring,std::allocator<std::wstring>>1> ]1> or 'std::_Vector_const_iterator<_Myvec>'1> with1> [1> _Myvec=std::_Vector_val<std::wstring,std::allocator<std::wstring>>1> ]So although it still seems like it deduces the same type for both it and e, it complains.
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results