How to have strongly typed numerical values?

bearophile bearophileHUGS at lycos.com
Thu Sep 6 04:14:19 PDT 2012


Nicholas Londey:

> however I am less convinced on systems that allow implicit 
> combining of units of the same quantity type. I feel part of 
> the type is its range and precision and so there is no valid 
> way to implicitly add kilometers to millimeters for example.

I see. If the range and precision are statically know then it's 
possible to design types that contain such values too. If they 
are known at run-time they need some run-time tests.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list