DIP54 : revamp of Phobos tuple types

Dicebot public at dicebot.lv
Sun Dec 29 07:42:28 PST 2013


On Sunday, 29 December 2013 at 15:01:03 UTC, Andrei Alexandrescu 
wrote:
> I think a duo `TemplateArgumentList` (auto-expansion) and 
> `TemplateArgumentPack` (no auto-expansion) in the same module 
> is the ticket. It also makes for a wonderful opportunity to 
> explain the distinction in the documentation and recommend 
> idioms for each.

I am concerned about cognitive load that explanations of all 
those concepts at once creates. Having minimal type set allows to 
descend deeper iteratively. It will also be hard to explain why 
this type is _needed_ in stdlib (at least for me, because I have 
no answer for that)

> To use your own argument: why add all those overloads instead 
> of requiring the user to use .expand with a 
> TemplateArgumentPack (or assuming we go with my suggestion 
> above, just use a TemplateArgumentList in the first place)?

Signature consistency. If you will use different algorithms in 
same code snippet (some with single variadic argument, some with 
multiple) having some of arguments augmented with .expand and 
some not is rather ugly.

I don't have strong preference here though and will be fine 
without adding overloads.

>> 3)
>> Point about omitting expanding library type still remains. I 
>> am still
>> looking for use case when those are really necessary (as a 
>> library type).
>
> See above. I think several people argued that there are plenty 
> of places where automatic expansion is the desired behavior.

Yep, but none of those featured auto-expanding _library_ type as 
part of desired behavior. May you point at specific example I 
have missed please?


More information about the Digitalmars-d mailing list