Bug 13068 – std.typecons.Unique should disable postblit
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-07-07T13:46:00Z
Last change time
2014-07-20T16:15:46Z
Keywords
pull
Assigned to
nobody
Creator
nick
Comments
Comment #0 by nick — 2014-07-07T13:46:20Z
Unique!int u1 = new int;
auto u2 = u1; // should be disallowed
auto u3 = u1.release; // ok
Otherwise u2 and u1 both own the same memory, which will be freed twice.
I'll make a pull request to fix this.