Another way to improve it is to add to D something like the "enum preconditions" I've discussed in past. So this bug can be detected at compile-time:

Bound!byte b = 200;

This is already handled

For example

    const b127 = saturated!byte(127);

compiles but

    const b128 = saturated!byte(128);

errors as

bound.d(421,32): Error: saturated (inout(byte) x) is not callable using argument types (int)

Reply via email to