compile-time opIndex

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 18 08:15:09 PST 2014


On 12/18/14 10:44 AM, Dicebot wrote:
> Have you seen my http://wiki.dlang.org/DIP63 ?

I admit this is somewhat over my head, but it seems to be more focused 
on types. I will note that your example:

struct Pack(T...)
{
    alias expand = T;
    alias expand this;
}

I don't think this would work, since you can't alias a value to a type?

But I don't use tuples regularly, so I am not sure where exactly expand 
is used. I thought it was to convert a concrete struct into a tuple of 
values, not a type tuple.

I don't disagree with the idea of having operators inside templates, I 
just don't know if it solves the problem I was looking at.

-Steve


More information about the Digitalmars-d mailing list