disposableObject

Wraps dispose method in virtual functions.

disposableObject
(
T
)

Examples

int count = 0;
struct TestDisposable
{
    void dispose()
    {
        count++;
    }
}

TestDisposable test;
Disposable disposable = disposableObject(test);
assert(count == 0);
disposable.dispose();
assert(count == 1);

Meta