Move construction from !is(T == typeof(this))

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 24 18:24:56 PDT 2017


On 04/24/2017 07:13 PM, Stanislav Blinov wrote:
> On Monday, 24 April 2017 at 22:46:18 UTC, Andrei Alexandrescu wrote:
>> On 04/24/2017 04:23 PM, ag0aep6g wrote:
>>> On 04/24/2017 08:48 PM, Stanislav Blinov wrote:
>>>> Speaking of const violation and UB, std.algorithm.mutation.move
>>>> seems to
>>>> violate const without remorse:
>>>
>>> Yup. Even in @safe code, which is a bug.
>>> https://issues.dlang.org/show_bug.cgi?id=15315
>>
>> Should fail in all situations, thanks for reporting.
>
> So, basically any type with const/immutable members effectively becomes
> immovable?

If the type moved from has no elaborate postblit, a move is the same as 
a copy so those should work.

> I'll make the PR.

Thanks!


Andrei


More information about the Digitalmars-d mailing list