tail const

Simen kjaeraas simen.kjaras at gmail.com
Sun Dec 26 03:20:12 PST 2010


Simen kjaeraas <simen.kjaras at gmail.com> wrote:

> After more problems, I have also come to the conclusion that what is
> most commonly needed is not really tail-const, but head-mutable. Why
> this took me more than a few minutes to consider, I do not know.
>
> Common use-cases would then look like this:
>
> struct MyRange( Range ) {
>      HeadMutable!Range r;
>      // Range primitives, TailConst support, etc.
> }

One might then think (I certainly did) that Tail(((Im|M)utable)|Const)
would be superfluous, and HeadMutable is the solution to all problems.
This is not true. HeadMutable is incapable of conveying that
TailMutable!T is implicitly castable to TailConst!T.


-- 
Simen


More information about the Digitalmars-d mailing list