Search code examples
c++visual-studio-2010visual-c++c++11auto

Compiler Issue with auto? Error: in a declarator-list 'auto' must always deduce to the same type


std::vector<int> vec;
auto i = vec.begin(), j = std::next(i);

Error: in a declarator-list 'auto' must always deduce to the same type


Solution

  • Compiles fine in g++ on Linux, so it appears to be a compiler bug. Probably this one.