inout auto ref escaping a reference to parameter, only errors with vibe Json type, or if inout is there.

aliak something at something.com
Tue Mar 12 16:58:41 UTC 2019


On Monday, 11 March 2019 at 22:29:05 UTC, aliak wrote:
> [...]

Here's a much reduces test case:

struct W(T) {}

struct S {
     int* data;
}

template match1(alias handler) {
     auto ref match1(T)(inout auto ref W!T w) {
         return handler();
     }
}

template match2(alias handler) {
     auto match2(T)(auto ref W!T w) {
         return match1!handler(w);
     }
}

void main() {
     W!int()
         .match2!(() => S());
}




More information about the Digitalmars-d-learn mailing list