C++11: “narrowing conversion inside { }” with modulus
In this specific case making id const or constexpr will fix the problem: constexpr unsigned int id = 100; since there is an exception for the case where you have a constant expression whose result after conversion will fit into the target type. In the more general case you may also use static_cast to cast … Read more