Re: Changing Template Static Ifs to Recursion

2017-06-01 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 21:02:07 UTC, jmh530 wrote: On Wednesday, 31 May 2017 at 19:22:18 UTC, Stefan Koch wrote: You could also use string mixins. Which will be more efficient then recursion. I try to avoid string mixins unless I can't help it. Nevertheless, I made an effort to try to

Re: Changing Template Static Ifs to Recursion

2017-05-31 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 19:22:18 UTC, Stefan Koch wrote: You could also use string mixins. Which will be more efficient then recursion. I try to avoid string mixins unless I can't help it. Nevertheless, I made an effort to try to get it to work and below seems to be working. I still hav

Re: Changing Template Static Ifs to Recursion

2017-05-31 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 19:25:22 UTC, ag0aep6g wrote: On 05/31/2017 08:50 PM, jmh530 wrote: Note: I left out the function foo, but think of foo is to Foo as tuple is to Tuple. You should have included foo, in my opinion. I'm having trouble figuring out what your code does. `process` inst

Re: Changing Template Static Ifs to Recursion

2017-05-31 Thread ag0aep6g via Digitalmars-d-learn
On 05/31/2017 08:50 PM, jmh530 wrote: Note: I left out the function foo, but think of foo is to Foo as tuple is to Tuple. You should have included foo, in my opinion. I'm having trouble figuring out what your code does. `process` instantiates foo with the field names. I'd need the definition

Re: Changing Template Static Ifs to Recursion

2017-05-31 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 18:50:27 UTC, jmh530 wrote: I have a struct that I am using like a Tuple, but I want to be able to opIndex in a different way than Tuple's opIndex. I want to be able to opIndex whatever is underlying the Tuple. [...] You could also use string mixins. Which will b

Changing Template Static Ifs to Recursion

2017-05-31 Thread jmh530 via Digitalmars-d-learn
I have a struct that I am using like a Tuple, but I want to be able to opIndex in a different way than Tuple's opIndex. I want to be able to opIndex whatever is underlying the Tuple. The code below works, but is kind of annoying because to extend you have to keep adding static ifs. I want to c