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

Matt Kline <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Matt Kline <[email protected]> ---
(In reply to bearophile_hugs from comment #1)

> What are some use cases of code like that?

Say struct Foo has a member Bar* b, which can either contain some optional data
or be null to indicate that no such data is currently present.

>From some other data structure, you procure an instance of Bar (call it other)
which you would like to assign to b. However, to make the lifetime of b
independent of its source, you want to create a garbage-collected copy of other
and assign it to b.

--

Reply via email to