Ada-Style Modulo Integer Types

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 22 12:52:46 PDT 2016


On Friday, 22 April 2016 at 17:37:44 UTC, Nordlöw wrote:
> Have anybody implement Ada-style modulo types
>
> https://en.wikibooks.org/wiki/Ada_Programming/Types/mod

Here's my first try

https://github.com/nordlow/phobos-next/blob/master/src/modulo.d

Is there a way to use

    alias _value this;

except mutation of _value which should check that _value is 
within value range (0 .. m-1)?


More information about the Digitalmars-d-learn mailing list