[Issue 8055] New: std.algorithm.move corrupts moved object field

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 6 19:15:05 PDT 2012


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

           Summary: std.algorithm.move corrupts moved object field
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-05-06 19:16:22 PDT ---
import std.algorithm;
struct S
{
    int x;
    ~this()
    {
        assert(x == 0);  // Line7
    }
}
S foo(S s)
{
    return move(s);
}
void main()
{
    S a;
    a.x = 0;
    auto b = foo(a);
    assert(b.x == 0);
}

-- 
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