comp.lang.ada
 help / color / mirror / Atom feed
From: Ivan Levashev <bu_gen@octagram.name>
Subject: Re: Smart Pointers and Tagged Type Hierarchies
Date: Thu, 27 Jul 2017 00:53:01 +0700
Date: 2017-07-27T00:53:01+07:00	[thread overview]
Message-ID: <olal1a$hsf$1@dont-email.me> (raw)
In-Reply-To: <2017072417413775878-contact@flyx.org>

24.07.2017 22:41, Felix Krause пишет:
> * A derived type, if it wants to provide additional operations (like
> Current_Position), must not only derive from Instance, but also from
> Reference, to be able to provide an type-safe interface to those
> operations.

My approach is to have independent (mutually noncastable) reference 
types and explicit upcast/downcast functions.

You can either copy all parent's methods by hand or use generic mix-ins 
to add methods to proto-reference-types for every reference type.

Also, tricks with Ada 2012 references can save Adjust/Finally calls. As 
soon as references don't have dispatching, tag is useless, so it can 
overlap with Ada 2012 reference's access discriminant.

Best Regards,
Ivan Levashev,
Barnaul

--
If you want to get to the top, you have to start at the bottom

  parent reply	other threads:[~2017-07-26 17:53 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 [this message]
2017-07-28  9:21 ` AdaMagica
2017-07-30 19:45   ` briot.emmanuel
2017-08-01  3:43 ` Randy Brukardt
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