[Issue 12684] Allow postblit elision when passing arguments to subfunctions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 22 15:42:43 UTC 2022


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
I don't this is possible. Think about reference counting. Maybe T is a
reference counted object. Once you call bar you need to update the number of
references that point to the object (you don't know what bar is going to do,
maybe it will escape the object in some variable), so you cannot avoid calling
the posblit/copy constructor.

I think that the correct way to go about this is to properly implement move
constructors and devise a last use dataflow analysis strategy that will allow
us to properly implement perfect forwarding.

I suggest closing this as invalid.

--


More information about the Digitalmars-d-bugs mailing list