On Monday, 23 December 2013 at 13:50:26 UTC, monarch_dodra wrote:
Ok... Then that'll break existing code that doesn't even *use* TypeTuple... Seems lose-lose to me :/

Yes, this DIP defines breaking transition that requires user action at some point. It is expected and approved by Andrei - we agreed that existing situation is even worse. But std.typetuple will remain as-is during deprecation process so there will be lot of time to do the change.

In any case, let me re-write my question it as:

staticIndexOf(int, TemplateArgumentList!(TemplateArgumentList!(int, double), int));

This time, its legal, right?

Yes. It is similar to indexOf(42, [ [ 42, 43 ], 42 ]) (forgetting about not being able to define such array type ;))

What result does it create?

1

Only the "outer" TAL gets auto-expanded, right?

Neither. But if you want to expand inner to create monotone list, you can do it explicitly:

staticIndexOf(int, TemplateArgumentList!(TemplateArgumentList!(int, double).expand, int));

// result is 0

With that said, I can only image that the implementation of templates that simply recurse would become very hard to imlement.

Can you give an example? I suspect you may over-complicate things a bit :)

I see value in having a packed type with explicit auto-expand, but I don't really see why it should replace the language's built-in variadic type list.

It does not replace built-in one. This DIP does not touch language itself at all and it is stated several times. Only thing which gets replaced is std.typetuple in Phobos and documentation.

Reply via email to