Preliminary submission - std.rational and std.typelist

Arlen arlen.ng at gmx.com
Sat Oct 6 12:28:03 PDT 2012


I'll have more to say about the design in the future.  At the moment for me porting Boost.Units to D is the fastest and the safest path to take.  Besides, the math behind it is sound and and many years of hard work has gone into it.  The problem with it, in my opionion, is that it's implemented in C++, :-).

I do want to mention that the distinction between dimension and unit is important.  I rather see this:

Quantity!(length, float) a = 2 * metre;

than this:

Quantity!(metre, float) a = 2 * metre;

I'll spend more time going over you library once I have some free time.

Thanks,

Arlen

> ----- Original Message -----
> From: David Nadlinger
> Sent: 10/06/12 12:58 PM
> To: digitalmars-d at puremagic.com
> Subject: Re: Preliminary submission - std.rational and std.typelist
> 
> I wrote a units library in D last year: 
> http://klickverbot.at/code/units/. Before setting out, I 
> extensively researched existing solutions in other languages, 
> Boost.Units being on of them, and I believe that I managed to 
> come up with a design which takes advantage of D's advanced 
> metaprogramming capabilities, and as such is more powerful while 
> being much less clunky.
> 
> For example, in comparison to Boost.Units, I didn't introduce a 
> notion of "dimension" separate from the concept of units, which 
> seemed to ultimately serve no purpose besides making valid 
> conversions easier to determine given the limitations of C++. I'd 
> love to hear your comments on the design!
> 
> 
> David



More information about the Digitalmars-d mailing list