On Thursday, 25 July 2019 at 21:58:06 UTC, aliak wrote:
Haha. Ironic. Thanks, again :)

Though, if you use auto ref, and you check if it's mutable and not copyable and then move, then that means you could potentially be applying move to an object on behalf of the clients

auto a = MyUnmovableType()
auto b = LibraryType(a);
writeln(a); // ??

If this is a problem, I guess a __traits(isRef, parameter) check along with mutable and copyable could help. Then if client want it moved they could call move explicitly.

Yeah, that's why you use core.lifetime.forward instead of directly calling move--it checks all of this stuff for you.

Reply via email to