Steve Schveighoffer <[email protected]> wrote:
> I agree with Andrei we need a language solution.  The question really is not 
> what the solution should do, that much is clear -- apply const to a subset of 
> the members (either all references or members designated by some identifier). 
>  
> The question is, what does the syntax look like.  That was the major 
> stumbling 
> block that flipped Walter's switch to "tail-const doesn't work".

I can think of a similar syntax as the inout for functions:

wild struct Range
{
    wild(Node)* cur;
    @property wild(V) front() wild { return cur.value; }
    void popFront() wild { cur = cur.next; }
    @property bool empty() wild { return next !is null; }
}

This wouldn't work with nested structs though.


Shin
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to