DIP54 : revamp of Phobos tuple types

Timon Gehr timon.gehr at gmx.ch
Sun Dec 29 21:22:55 PST 2013


On 12/30/2013 05:55 AM, Dicebot wrote:
>
> Ah I was referring to the fact that it does not seem to compile even
> assuming normal non-template parameters as indexes (which looks like a
> bug). Other part (which is real desired one) is not allowed by spec
> right now indeed.
>
> struct X
> {
>      static int opSlice(size_t a, size_t b)
>      {
>          return 42;
>      }
> }
>
> static assert ( X[1..2] == 42 );
>
> // Error: cannot slice type 'X'
>
> I expected this one to work.

Ah, I see.


More information about the Digitalmars-d mailing list