comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Smart Pointers and Tagged Type Hierarchies
Date: Mon, 31 Jul 2017 22:43:37 -0500
Date: 2017-07-31T22:43:37-05:00	[thread overview]
Message-ID: <olotda$sqc$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 2017072417413775878-contact@flyx.org

"Felix Krause" <contact@flyx.org> wrote in message 
news:2017072417413775878-contact@flyx.org...
...
> A problem I encounter is how this can be used with type hierarchies i.e. I 
> have a smart pointer managing a tagged type, and I want to be able to 
> derive from that tagged type and still be able to use my smart pointer 
> with that new type.

What's needed is something like "co-derivation", where multiple types are 
derived in lock-step. Sadly, this is effectively impossible in an OOP 
environment, because dispatching calls would have the wrong parameter types 
for any co-derived types. (I've spent quite a bit of effort in trying to 
make such a solution work, and have enlisted others to help, but the 
conclusion was that it wasn't promising.)

One would have to have some form of multiple dispatch to get around that, 
but that's a bridge too far for a language that's mainly used in embedded, 
safety-critical systems.

One could make it work for non-tagged types, but of course that prevents 
dispatching and extension. So it's probably not worth the effort to design.

                                       Randy.



  parent reply	other threads:[~2017-08-01  3:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 15:41 Smart Pointers and Tagged Type Hierarchies Felix Krause
2017-07-24 19:53 ` Dmitry A. Kazakov
2017-07-27 19:30   ` Felix Krause
2017-07-27 20:42     ` Dmitry A. Kazakov
2017-07-24 21:24 ` Chris Moore
2017-07-27 19:38   ` Felix Krause
2017-08-01  4:07     ` Randy Brukardt
2017-07-26 17:53 ` Ivan Levashev
2017-07-28  9:21 ` AdaMagica
2017-07-30 19:45   ` briot.emmanuel
2017-08-01  3:43 ` Randy Brukardt [this message]
2017-08-01  7:36   ` Dmitry A. Kazakov
2017-08-01 22:41     ` Randy Brukardt
2017-08-02  6:28       ` Dmitry A. Kazakov
2017-08-02 19:26         ` 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