eating inout dogfood

Kagamin spam at here.lot
Fri Oct 14 01:43:15 PDT 2011


Steven Schveighoffer Wrote:

> struct cursor(T)
> {
>     T* node;
>     void popFront() {node++;}
>     ... // usual suspects front, empty, etc
> }
> 
> This seems like cursor!(inout(V)) might work (V is the element type of the  
> container) as the return type for inout functions.  However, one of the  
> major requirements of inout is that it correctly cast back to the  
> constancy of the container.

try to return inout(cursor!(Unqual!(V)))


More information about the Digitalmars-d mailing list