I am looking into a code snippet for the Dancing Links (DLX) algorithm in its pure, general form; not for Sudoku specifically. I found what I'm looking for here: https://github.com/jlaire/dlx-cpp/blob/master/dlx.cpp. At line 176, I came across the code "for (auto& row : rows){". I've never seen this "for" syntax before. My compiler (VC++ 2010) doesn't like and hence it doesn't compile. Can anybody explain what it means? Any work around? Any help is greatly appreciated.
its the c++ 11 range based for loop. what it does is iterate through each element in an array. i dont use vc++ but ive heard it doesnt work well with c++11. however it doesnt hurt to try and compile with -std=c++11, which is what you need to use c++11 features
Thanks everybody for the quick responses. From your comments above, if sticking to VS 2010 which appears not to have the range based for loop, the equivalent of "for (auto& row : rows)" would be "for(int row = 0; row < rows.size(); row++)" where rows is a vector int??