opApply and const

Janice Caron caron800 at googlemail.com
Sun Dec 9 00:33:44 PST 2007


On 12/9/07, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
> const int opApply(int delegate(ref const T)) {...}

And "ref const T" seems a bit of an oxymoron anyway.

I can bring it down to eight. You shouldn't have to deal with
invariant classes. These can't really exist in D, since

    invarant C = new C;

will fail to compile, and there is no "inew".

But yeah - eight versions of the same function is too much. Is there
any way we can narrow it down to one? (One that actually works, in all
eight cases?)



More information about the Digitalmars-d mailing list