foreach doesn't seem to know about invariant

Janice Caron caron800 at googlemail.com
Thu Nov 22 11:26:01 PST 2007


It'll be interesting to see how we're supposed to overload that with
opApply, taking const into account, in the next version of const. Do
we have to write the function twice? (Four times if you also have to
write Value-only versions).

const int opApply(int delegate(Key key, Value value) dg)
{
    /* whatever */
}

int opApply(int delegate(Key key, ref Value value) dg)
{
    /* whatever */
}

I don't think you can say "ref const(Value) value".



More information about the Digitalmars-d mailing list