On Thursday, 13 December 2018 at 23:33:39 UTC, Stanislav Blinov
wrote:
On Thursday, 13 December 2018 at 13:17:05 UTC, aliak wrote:
[...]
Hypothetically, yes, e.g. an object that contains references to
itself. However, D operates on the assumption that you don't
have such objects. And even though it can't be statically
checked, move and swap do actually perform this check at
runtime in debug builds.
Operating under that rule, it should be legal to move any
values that are passed to you. In fact, I postulate that it
*must* be done instead of making copies. Unfortunately, Phobos
doesn't agree.
[...]
Oh cool! An isRef trait. TIL!
And I see, thank you all for the tips!