Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-11 Thread ryuukk_ via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:48:20 UTC, Paul Backus wrote: On Friday, 8 July 2022 at 12:20:13 UTC, ryuukk_ wrote: The problem when i try to introduce variadic template, is i can't seem to understand how to unwrap the parameter as pointer type T -> T* ```D struct Includes(Args...) { alias

Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread wjoe via Digitalmars-d-learn
Corrections: On Friday, 8 July 2022 at 12:40:52 UTC, wjoe wrote: alias Recurse = AliasSeq!(Arg[0]*, Recurse!(Arg[0..$]); ```d alias Recurse = AliasSeq!(Arg[0]*, Recurse!(Arg[1..$]); ``` void view_it(Args...)(void function(entity_t, Includes!(Args) ) ```d void

Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread Paul Backus via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:20:13 UTC, ryuukk_ wrote: The problem when i try to introduce variadic template, is i can't seem to understand how to unwrap the parameter as pointer type T -> T* ```D struct Includes(Args...) { alias args = Args; } void view_it(Includes)(void function(entity_t,

Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread wjoe via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:20:13 UTC, ryuukk_ wrote: I'm not sure how to phrase it so it'll try with code I have this piece of code that i would like to improve, right now i have to create bunch of duplicates ```D void view_it(A, B)(void function(entity_t, A*, B*) cb) {

Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread ryuukk_ via Digitalmars-d-learn
I'm not sure how to phrase it so it'll try with code I have this piece of code that i would like to improve, right now i have to create bunch of duplicates ```D void view_it(A, B)(void function(entity_t, A*, B*) cb) { foreach(it, e; view!(Includes!(A, B))) {