Bug 6424 – std.traits.hasElaborateAssign is limited
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-01T07:34:00Z
Last change time
2011-08-05T22:34:47Z
Keywords
rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2011-08-01T07:34:47Z
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.