Can you move a disabled this(this) struct in to a container type if it's an rvalue?
Q. Schroll
qs.il.paperinik at gmail.com
Sun Dec 16 04:02:57 UTC 2018
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:
>
>> Ah. Is there any case where you would not want to do that when
>> you have a T value as parameter?
>
> Hypothetically, yes, e.g. an object that contains references to
> itself. However, D operates on the assumption that you don't
> have such objects.
The spec actually forbids you creating self referencing structs.
DIP 1014 tackles that. For the spec, see
https://dlang.org/spec/garbage.html#pointers_and_gc
More information about the Digitalmars-d-learn
mailing list