www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2801] New: std.typecons.Unique does not work

reply d-bugmail puremagic.com writes:

           Summary: std.typecons.Unique does not work
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jarrett.billingsley gmail.com

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.

Apr 04 2009
parent d-bugmail puremagic.com writes:

Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |andrej.mitrovich gmail.com

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-05-26
12:55:25 PDT ---
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

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 26 2011