Comment Comment by dsfuoi It looks easy but it isn't.The second example causes unexpected behavior (and probably ub later) if: min + step > MIN_TYPE_MAXThe last example causes undefined behavior if: max - min < step - 1. parent dsfuoi 10 years ago
The second example causes unexpected behavior (and probably ub later) if: min + step > MIN_TYPE_MAX
The last example causes undefined behavior if: max - min < step - 1.