On Monday, 31 August 2015 at 12:54:05 UTC, Sebastiaan Koppe wrote:
What about:

```
class MyResource
{
    void* handle;
    this()
    {
        handle = create_handle();
    }
    close()
    {
        if (handle)
            free_handle(handle)
        handle = null;
    }
    ~this()
    {
        enforce(!handle,"Resource leak");
    }
}
```



Unique!T destructor calls delete which calls ~this() not close()
RefCounted!T and scoped!T call .destroy which calls ~this() not close()
We really want one thing there.

Reply via email to