www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6424] New: std.traits.hasElaborateAssign is limited

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6424

           Summary: std.traits.hasElaborateAssign is limited
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



Follwing code should compile:

struct S
{
  void opAssign(T)(auto ref T rhs)
    if (!__traits(isRef, rhs))
  {}
}
static assert(hasElaborateAssign!S);

Because hasElaborateAssign!T checks is(typeof(T.init.opAssign(T.init))),
but T.init is always lvalue, so S cannot pass its test.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 01 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6424


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



https://github.com/D-Programming-Language/phobos/commit/5fc6ec7b372fc6901795367e723a016ad631b199

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