static foreach and inline if

JS js.mdnq at gmail.com
Sun Jul 28 08:33:47 PDT 2013


On Sunday, 28 July 2013 at 09:11:55 UTC, anonymous wrote:
> On Sunday, 28 July 2013 at 08:38:40 UTC, JS wrote:
>> On Sunday, 28 July 2013 at 08:38:01 UTC, JS wrote:
>>> On Sunday, 28 July 2013 at 08:30:17 UTC, QAston wrote:
>>>> On Saturday, 27 July 2013 at 17:14:35 UTC, JS wrote:
>>>>> I'd like to have foreach and inline if in templates:
>>>>
>>>> inline if is available as std.traits.Select
>>>
>>> This doesn't work for variadic args...
>>>
>>> Something Split!(Cond, targ..., split, fargs) is what I 
>>> need... where split somehow signals the split between the two.
>>
>> Obviously I mean Select!
>
> template Wrap(Stuff ...) {alias unwrap = Stuff;}
> Select!(cond, Wrap!targs, Wrap!fargs).unwrap

I tried to do that with tuple which is identical to your wrap but 
was not successful... possibly because I did not unwrap it...


More information about the Digitalmars-d-learn mailing list