On Mon, Jan 27, 2020 at 09:15:58PM +0000, Herbert via Digitalmars-d-learn wrote: [...] > How can I have a function parameter with this type (DiceValue)?
Just take an integer type and add a contract that enforces range. For example: auto myFunc(int diceValue) in (diceValue >= 1 && diceValue <= 6) { // do stuff here } T -- Which is worse: ignorance or apathy? Who knows? Who cares? -- Erich Schubert