Why is this code a non-constant condition?
static_assert(4294965 * 1000 / 1000 == -2, "overflow occurs");
But this is not:
const int overflowed = 4294965 * 1000 / 1000; static_assert(overflowed == -2, "overflow occurs");
See code on godbolt.
Aucun commentaire:
Enregistrer un commentaire