On Mon, 16 Aug 2010 09:11:20 -0400, dsimcha <dsim...@yahoo.com> wrote:

== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
There are other reasons to have tail-const other than classes.  For
example, there's no equivalent custom-range idiom for const(T)[].  You
simply can't make a custom range tail-const.
I admit I haven't used Rebindable much, but last I checked it was severely
out of date.
-Steve

Rebindable's gotten a significant facelift lately. Admittedly there are still
bugs but these are bugs in alias this/opDot, not in rebindable itself.

How do you tail-const a range?

struct Node(V)
{
   V v;
   Node * next;
}

struct Range(V)
{
   Node!V *n;

   void popFront() {n = n.next};
}

How does one implement popFront so it works on:

Rebindable!(const(Range!V)) r;

???

Rebindable is specifically for class references, it does nothing for ranges.

-Steve

Reply via email to