segfault in ldc release only - looks like some kind of optimization bug?

Exil Exil at gmall.com
Tue Jul 23 00:36:49 UTC 2019


auto ref get(T)(W!T value) {
     return value.front;
}

You're returning a reference to a temporary that gets deleted at 
the end of the function's scope. The "auto ref" here will be a 
"ref".


More information about the Digitalmars-d-learn mailing list