[Issue 15662] Cannot move struct with defined opAssign due to @disabled post-blit

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Mar 19 18:01:37 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15662

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu

--- Comment #10 from Martin Nowak <code at dawg.eu> ---
(In reply to Dicebot from comment #9)
> Yes, this is close to what I had in mind (main difference is that I need
> re-allocation to be allowed too, invalidating previous block, but that is
> also trivially doable).

You can't really do what you want w/o being the sole owner of the underlying
array. If that's guaranteed, i.e. noone else has a slice or any other
reference, you can just realloc and bit blit.
So it'd be very unsafe for blank arrays (b/c they allow escaping), but a custom
array wrapper/implementation would work.

--


More information about the Digitalmars-d-bugs mailing list