Skip to content

Commit ace0b93

Browse files
authored
Merge pull request #4763 from tmccombs/unique-cleanup
Unique cleanup
2 parents 1a7914a + ae8fa4e commit ace0b93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

std/typecons.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public:
146146
~this()
147147
{
148148
debug(Unique) writeln("Unique destructor of ", (_p is null)? null: _p);
149-
if (_p !is null) delete _p;
149+
if (_p !is null) destroy(_p);
150150
_p = null;
151151
}
152152
/** Returns whether the resource exists. */
@@ -163,8 +163,9 @@ public:
163163
debug(Unique) writeln("return from Release");
164164
return u;
165165
}
166+
166167
/** Forwards member access to contents. */
167-
auto opDot() inout { return _p; }
168+
mixin Proxy!_p;
168169

169170
/**
170171
Postblit operator is undefined to prevent the cloning of $(D Unique) objects.

0 commit comments

Comments
 (0)