File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
druntime/src/core/internal Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,10 @@ void __move_post_blt(S)(ref S newLocation, ref S oldLocation) nothrow
4040
4141 static if (__traits(hasMember, S, " opPostMove" ))
4242 {
43- import core.internal.traits : lvalueOf, rvalueOf;
44- static assert ( is (typeof (S.init.opPostMove(lvalueOf! S))) &&
45- ! is (typeof (S.init.opPostMove(rvalueOf! S))),
43+ import core.internal.traits : Parameters;
44+ static assert (Parameters! (S.init.opPostMove).length == 1 &&
45+ is (Parameters! (S.init.opPostMove)[0 ] : S) &&
46+ __traits(getParameterStorageClasses, S.init.opPostMove, 0 )[0 ] == " ref" ,
4647 " `" ~ S.stringof ~ " .opPostMove` must take exactly one argument of type `" ~ S.stringof ~ " ` by reference" );
4748
4849 newLocation.opPostMove(oldLocation);
Original file line number Diff line number Diff line change @@ -248,8 +248,10 @@ template hasElaborateMove(S)
248248 }
249249 else static if (is (S == struct ))
250250 {
251- enum hasElaborateMove = (is (typeof (S.init.opPostMove(lvalueOf! S))) &&
252- ! is (typeof (S.init.opPostMove(rvalueOf! S)))) ||
251+ enum hasElaborateMove = (is (typeof (S.init.opPostMove)) &&
252+ Parameters! (S.init.opPostMove).length == 1 &&
253+ is (Parameters! (S.init.opPostMove)[0 ] : S) &&
254+ __traits(getParameterStorageClasses, S.init.opPostMove, 0 )[0 ] == " ref" ) ||
253255 anySatisfy! (.hasElaborateMove, Fields! S);
254256 }
255257 else
You can’t perform that action at this time.
0 commit comments