On Wed, 05 Sep 2012 02:55:45 +0200, Nicholas Londey <lon...@gmail.com> wrote:

Hello.
I am trying to work out if there is existing support for strongly typed numerical values for example degrees west and kilograms such that they cannot be accidentally mixed in an expression. I have vague recollection of seeing a presentation by Walter talking about this but I cannot seem to find it. I have looked at std.typecons.Typedef and Proxy but neither seem to do what I want or at least fail to compile for the expression n = n + n;. I could easily implement my own as I have done in C++ in the past but assume there is a standard implementation which I would prefer.
Any help or links to examples much appreciated.

Regards,

Nicholas

Not mine, but this is the implementation I use:

https://github.com/klickverbot/phobos/tree/units/std

Files are units.d and si.d.

Documentation:
http://klickverbot.at/code/units/std_units.html
http://klickverbot.at/code/units/std_si.html

--
Simen

Reply via email to