c++11 style for loop
c++11 : use ```constexpr name2int`` switch instead of if/else