On Saturday, 22 July 2017 at 06:08:59 UTC, Cecil Ward wrote:
On Saturday, 22 July 2017 at 03:18:29 UTC, Cecil Ward wrote:
[...]

I saw David Nadlinger's units package. I'd like to know how the strong typing works.

By wrapping in structs and overloading operators [1][2][3][4].

[1] https://github.com/klickverbot/phobos/blob/units/std/units.d#L727 [2] https://github.com/klickverbot/phobos/blob/units/std/units.d#L736 [3] https://github.com/klickverbot/phobos/blob/units/std/units.d#L756 [4] https://github.com/klickverbot/phobos/blob/units/std/units.d#L765

Reply via email to