Re: Function parameters from TypeTuple

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 17:44:47 + Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int,

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... template arrayType(T) { alias arrayType = T[]; } template multiAccess(Args ...) { auto multiAccess(int i,

Re: Function parameters from TypeTuple

2014-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2014 10:44 AM, Tofu Ninja wrote: Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int, char) would be (int[], char[])... No matter what I try, the compiler

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:55:14 UTC, Ali Çehreli wrote: Yeah.. I dont think I was clear the first time...

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote: Also my inability to get this working is probably rooted in my lack of understanding of the differences between tuple vs Tuple vs TypeTuple vs expression tuples ...

Re: Function parameters from TypeTuple

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 17:57:57 + Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... still can't grasp

Re: Function parameters from TypeTuple

2014-10-17 Thread Justin Whear via Digitalmars-d-learn
On Fri, 17 Oct 2014 17:44:47 +, Tofu Ninja wrote: Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int, char) would be (int[], char[])... No matter what I try,

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 18:22:12 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 17:57:57 + Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense,

Re: Function parameters from TypeTuple

2014-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2014 11:35 AM, Tofu Ninja wrote: I am not even sure any more, I am starting to get lost in the tuple madness... You want to write a function that takes an index and a number of arrays; and returns an N-ary Tuple where N matches the number arrays passed to the function: :p

Re: Function parameters from TypeTuple

2014-10-17 Thread anonymous via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... You forgot the imports. template arrayType(T) { alias

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 19:03:42 UTC, anonymous wrote: On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... You

Re: Function parameters from TypeTuple

2014-10-17 Thread anonymous via Digitalmars-d-learn
On Friday, 17 October 2014 at 19:18:29 UTC, Tofu Ninja wrote: I had the imports, I just didn't post them. My problem is most likely that I used Tuple! instead of tuple... which is probably because the differences between the like 20(exaggeration) different types of tuples in D are confusing as

Re: Function parameters from TypeTuple

2014-10-17 Thread Justin Whear via Digitalmars-d-learn
On Fri, 17 Oct 2014 11:56:31 -0700, Ali Çehreli wrote: You want to write a function that takes an index and a number of arrays; and returns an N-ary Tuple where N matches the number arrays passed to the function: :p http://dlang.org/phobos/std_range.html#transversal

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 19:32:40 UTC, anonymous wrote: On Friday, 17 October 2014 at 19:18:29 UTC, Tofu Ninja wrote: I had the imports, I just didn't post them. My problem is most likely that I used Tuple! instead of tuple... which is probably because the differences between the like