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
40
40
41
41
static if (__traits(hasMember, S, " opPostMove" ))
42
42
{
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" ,
46
47
" `" ~ S.stringof ~ " .opPostMove` must take exactly one argument of type `" ~ S.stringof ~ " ` by reference" );
47
48
48
49
newLocation.opPostMove(oldLocation);
Original file line number Diff line number Diff line change @@ -248,8 +248,10 @@ template hasElaborateMove(S)
248
248
}
249
249
else static if (is (S == struct ))
250
250
{
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" ) ||
253
255
anySatisfy! (.hasElaborateMove, Fields! S);
254
256
}
255
257
else
You can’t perform that action at this time.
0 commit comments