"<Type> is not mutable" when using ref return type

%u wfunction at hotmail.com
Wed May 18 20:55:50 PDT 2011


Hi!

Is this a bug, or is it intentional that this fails? I can't come up
with any case where it would cause a problem, but the compiler doesn't
like the fact that there's a const in the structure:

    struct Temp { const int a; int b; }

    auto ref foo(Temp* t) { return *t; } //Error


More information about the Digitalmars-d mailing list