--- Comment #8 from Stewart Gordon <> 2012-03-09 15:42:40 PST ---
I think the claim that the reporter is actually making is that the inout
constancy of the delegate parameter should vary with that of this.  In other

    int opApply(int delegate(ref inout(int)) dg) inout

should be callable as if it's any one of these:

    int opApply(int delegate(ref int) dg)
    int opApply(int delegate(ref const(int)) dg) const
    int opApply(int delegate(ref immutable(int)) dg) immutable

I was trying to do this myself before this issue was filed.

(In reply to comment #6)
> 3.  Aside from all the above, inout already has different semantics 
> inside function bodies, so it would be ambiguous to have another 
> instance of inout in a variable declaration because you can only 
> refer to one constness (that of the args of the current function).

Indeed.  The point is that there are two possible interpretations of the
opApply signature, and the spec isn't clear on which applies:

(a) the constancy is passed through to the delegate
(b) the delegate has an inout parameter in its own right

See the newsgroup thread I've already linked to for a more detailed discussion
of this.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to