Bug 2801 – std.typecons.Unique does not work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-04-04T23:53:00Z
Last change time
2015-06-09T01:18:03Z
Keywords
rejects-valid
Assigned to
andrei
Creator
jarrett.billingsley

Comments

Comment #0 by jarrett.billingsley — 2009-04-04T23:53:57Z
I can't get anything to compile, even the example code: import std.typecons; class A {} void main() { Unique!(A) a = new A(); } This just gives the error: foo.d(12): Error: e2ir: cannot cast from foo.A to Unique!(A) I've tried classes, structs, basic types etc. They all give the same error.
Comment #1 by andrej.mitrovich — 2011-05-26T12:55:25Z
This works now. But why on earth do the ctor, dtor and release call writeln? rdmd test.d: Unique constructor with rvalue Unique destructor of uniqtest.A