D's metaprogramming could be flawed

rsw0x via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 22 06:19:30 PST 2016


On Friday, 22 January 2016 at 13:28:00 UTC, maik klein wrote:
> On Friday, 22 January 2016 at 13:21:11 UTC, rsw0x wrote:
>> On Friday, 22 January 2016 at 12:57:54 UTC, maik klein wrote:
>>> ...
>>
>> You're looking for AliasSeq in std.meta, it's a tup—er, finite 
>> ordered list of types :)
>
> I am already aware of AliasSeq as I have written above. But I 
> could have misused it, would you mind showing an example with 
> TupleRef?

Sorry, I must have skipped that.

Is there a reason you're explicitly using tuples?
Unless I'm misunderstanding you, you're looking for something 
like...

struct Baz(V...) {
   V vals;
}

which can be used like...

void foo(int, int, int) {

}

void main(){
   auto i = Baz!(int, int, int)();
   foo(i.vals);
}

or am I way off base?

If so, is this similar to what you're looking for?
http://dpaste.dzfl.pl/cbae4c4ed7af

Sorry if I'm nowhere near what you meant.


More information about the Digitalmars-d mailing list