The worst Phobos template (in binderoo)

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 15 07:08:09 PDT 2016


On Thursday, 15 September 2016 at 13:49:46 UTC, Andrei 
Alexandrescu wrote:
> On 09/15/2016 09:27 AM, Stefan Koch wrote:
>> On Thursday, 15 September 2016 at 13:20:16 UTC, Andrei 
>> Alexandrescu wrote:
>>> On 09/15/2016 08:35 AM, Stefan Koch wrote:
>>>> On Thursday, 15 September 2016 at 12:26:08 UTC, Andrei 
>>>> Alexandrescu
>>>> wrote:
>>>>>
>>>>> Apparently we need that static foreach iteration. -- Andrei
>>>>
>>>> What exactly do you mean ?
>>>> As long as we instanciate n templates for a member nested n 
>>>> levels the
>>>> overhead is massive!
>>>> How would static foreach help ?
>>>
>>> I thought staticMap is just a (simulated) loop that applies 
>>> the same
>>> template in sequence. -- Andrei
>>
>> staticMap is a recursive variadic template.
>
> Can recursion be replaced with iteration? Assume you have 
> static foreach at your disposal. -- Andrei

You tell me, you are the expert on templates :o)
I cannot be certain but I think, It would probably work.

static foreach on the other hand is a whole new can of worms.
As walter will be able to tell you.



More information about the Digitalmars-d mailing list