BetterC is so much bugs, is Walter really use it in DMD?
SrMordred
patric.dexheimer at gmail.com
Thu Oct 25 15:48:43 UTC 2018
On Thursday, 25 October 2018 at 13:28:22 UTC, rikki cattermole
wrote:
> After minimizing it myself (at the end), I think that you're
> running into https://issues.dlang.org/show_bug.cgi?id=18457
>
> struct Node {}
> struct Proxy {
> ~this() {
> count++;
> }
>
> Node* n;
> }
>
> ref auto something(Node* p){
> auto value = Proxy(p);
> return value;
> }
>
> __gshared int count;
>
> extern(C) void main() {
> Node n;
> something(&n);
> assert(count == 1);
> }
I started to make some BetterC libs and fall on this same bug.
It make it impossible to properly control resources lifetime if
you return it from functions ;/
More information about the Digitalmars-d
mailing list