While being a very modest piece of code in and of itself, I believe this offers a significant opportunity that both D compilers and user defined types can exploit.

Not only can it be used to create an efficient safeint data type, it can be used to implement multi-precision integer arithmetic types.

I'd also like to see it used to replace the various ad-hoc schemes currently in use. It should also be used in dmd itself for things like detecting array size overflows, which is currently done ad-hoc, and detecting overflows in CTFE.

For background information and rationale, see

Reply via email to