[Issue 5501] New: Variant wrongly assumes that an object's length property returns a size_t

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 29 01:02:06 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5501

           Summary: Variant wrongly assumes that an object's length
                    property returns a size_t
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dransic at free.fr


--- Comment #0 from Nicolas Sicard <dransic at free.fr> 2011-01-29 00:59:57 PST ---
The following code doesn't compile. I hit the problem when using
std.datetime.Interval (which length returns a Duration).

import std.variant;

struct Foo {
    double length() {
        return double.init;
    }
}

unittest {
    Foo foo;
    Variant v = foo;
}

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


More information about the Digitalmars-d-bugs mailing list