c++ - Visual Studio C++11g compilation error - too many initializers -
i trying compile following source code using visual studio 2012 professional , getting compilation errors. same code working in visual studio 2013. when check vs 2012, supports of c++ 11 features. program built using c++ 11 compliant compiler. found program http://lucid-motif.blogspot.com/2013/11/coding-puzzle-knight-sequences.html?
typedef enum { _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_1,_2,_3 } tkeyidentity; typedef std::vector<tkeyidentity const> tkeypath typedef std::vector<tkeypath const> tkeymap; const tkeymap keypad = { { _h, _l }, // { _i, _k, _m }, // b { _f, _j, _l, _n }, // c { _g, _m, _o }, // d { _h, _n }, // e { _c, _m, _1 }, // f (_1) not valid 2 moves followed 1 move rule { _d, _n, _2 }, // g { _a, _e, _k, _o, _1, _3 }, // h { _b, _l, _2 }, // { _c, _m, _3 }, // j (_3) not valid 2 moves followed 1 move rule { _b, _h, _2 }, // k { _a, _c, _i, _3 }, // l { _b, _d, _f, _j }, // m { _c, _e, _g, _1 }, // n { _d, _h, _2 }, // o (oh) { _f, _h, _n }, // 1 { _g, _i, _k, _o }, // 2 (_k) & (_o) not valid 2 moves followed 1 move rule { _h, _j, _l } // 3 }; const tkeypath keypadroot = { _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _1, _2, _3 }
the keypad , keypadroot initializers giving below errors
error 3 error c1903: unable recover previous error(s); stopping compilation error 2 error c2078: many initializers
error 1 error c2552: 'keypad' : non-aggregates cannot initialized initializer list
thanks help.
vc2012 not support, , not claim support, entire c++11 standard.
initialiser lists 1 of things omitted.
vc2015 implements practically entire c++11 standard, ought upgrade that. (i believe sfinae support still missing).
Comments
Post a Comment