From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Smart pointers and delegation
Date: Tue, 8 Aug 2017 19:27:15 -0500
Date: 2017-08-08T19:27:15-05:00 [thread overview]
Message-ID: <omdkt3$lqf$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: omblk3$svi$1@gioia.aioe.org
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:omblk3$svi$1@gioia.aioe.org...
> On 2017-08-08 00:39, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:om3vsc$jhk$1@gioia.aioe.org...
...
>>> Implicit dereferencing semantically does the same. For each visible
>>> operation of the target type it declares an anonymous operation of the
>>> reference type that dereferences and then calls to the original
>>> operation.
>>
>> I don't see this at all.
>
> You do it with the eyes closed... (:-))
That's possible. I'm not the best at seeing patterns; I'm much more likely
to write everything from scratch. Thus I don't find use for interfaces, for
one example.
...
>> It's not really opposite, though, if you want to limit the lifetime of
>> the
>> reference (even if that limit is potentially a long time).
>
> Why would I want this, if the reference manages the object? The cardinal
> difference is between object-managed references and reference-managed
> objects. The former has a very limited use and would prefer to have all of
> them built-in.
In that case, you definitely need to know precisely when the reference dies,
so you can "manage the object". If you have a lifetime leak (such as any
normal access type does), then you can't do that management safely. The
pattern of the intended use-case of Implicit_Dereference does exactly this.
Yes, I agree that it would have been better to have an explicit call-back
(that was the original idea, after all), but that was a lot more complex in
language and implementation terms. I don't think the complex version was
going to fly, and the simple version solves the problem that we needed to
solve. Sometimes, a "meh" idea that you can actually get implemented is
better than a brilliant idea that doesn't get any traction and thus never
actually exists anywhere.
Randy.
Randy.
next prev parent reply other threads:[~2017-08-09 0:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 10:32 Smart pointers and delegation Dmitry A. Kazakov
2017-08-01 15:06 ` Dmitry A. Kazakov
2017-08-01 23:06 ` Randy Brukardt
2017-08-02 6:20 ` Dmitry A. Kazakov
2017-08-03 3:36 ` Randy Brukardt
2017-08-03 7:40 ` Dmitry A. Kazakov
2017-08-04 23:03 ` Randy Brukardt
2017-08-05 8:33 ` Dmitry A. Kazakov
2017-08-07 22:39 ` Randy Brukardt
2017-08-08 6:27 ` Dmitry A. Kazakov
2017-08-09 0:27 ` Randy Brukardt [this message]
2017-08-09 7:37 ` Dmitry A. Kazakov
2017-08-09 22:57 ` Randy Brukardt
2017-08-10 7:56 ` Dmitry A. Kazakov
2017-08-11 0:17 ` Randy Brukardt
2017-08-11 6:43 ` Dmitry A. Kazakov
2017-08-11 20:37 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox