Preliminary submission - std.rational and std.typelist

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Oct 7 02:16:47 PDT 2012


On 07-Oct-12 11:23, Philippe Sigaud wrote:
> On Sat, Oct 6, 2012 at 8:01 PM, Arlen <arlen.ng at gmx.com> wrote:
>> I'm not sure if TypeTuples work well when doing things like dimensional analysis.  For example, if you have two TypeTuples, A and B, what would the signature of the metafunction to merge the two look like?
>>
>> template Merge(A, B) { }
>>
>> won't work, and neither will
>>
>> template Merge(alias A, alias B) { }
>>
>> and you certainly can't do something like
>>
>> template Merge(AB...) { }
>
> Double-stage templates (which reminds me of rocket science :)  )
>
> template Merge(A...)
> {
>      template With(B...)
>      { }
> }
>
>
> Usage:
>
> Merge!(int,double,string).With!(double,byte)
>
Rox!

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list