comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Equivalent of dynamic_cast (downcast) for tagged types
Date: Thu, 27 Jan 2011 14:49:37 -0800 (PST)
Date: 2011-01-27T14:49:37-08:00	[thread overview]
Message-ID: <026d387e-1dd9-4551-b06a-5a5fa471ddd1@r4g2000vbq.googlegroups.com> (raw)
In-Reply-To: ihs8up$i7f$1@news.eternal-september.org

On Jan 27, 6:10 pm, "J-P. Rosen" <ro...@adalog.fr> wrote:

> It's bad practice in C++ because it is unsafe.

It is perfectly safe in the form that I have presented.
Another version with references is also perfectly safe, as it does not
even produce any null pointer value and throws an exception - which is
equivalent to what Ada does.

> Admitedly, it not very OOrthodox, but OOrthodoxy has been defined by C++
> people!

Please note that object orientation actually works in C++, whereas it
demonstrably doesn't work with GNAT (see my response to Dmitry for
details) and we are talking about the time gap of some 20 years. I
fully understand your opinion about C++, but in this particular case
it would be very difficult to defend.

OK, now ducking away to move forward my Ada project. ;-)

--
Maciej Sobczak * http://www.inspirel.com



  parent reply	other threads:[~2011-01-27 22:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 15:46 Equivalent of dynamic_cast (downcast) for tagged types Maciej Sobczak
2011-01-27 16:18 ` Dmitry A. Kazakov
2011-01-27 17:10   ` J-P. Rosen
2011-01-27 17:35     ` Dmitry A. Kazakov
2011-01-27 22:49     ` Maciej Sobczak [this message]
2011-01-27 17:50   ` Georg Bauhaus
2011-01-27 22:35   ` Maciej Sobczak
2011-01-28  5:07     ` Yannick Duchêne (Hibou57)
2011-01-28  9:16     ` Dmitry A. Kazakov
2011-01-28 13:11       ` AdaMagica
2011-01-28 14:13         ` Dmitry A. Kazakov
2011-01-28 23:51           ` Randy Brukardt
2011-01-29  0:55             ` Adam Beneschan
2011-01-28 16:44       ` Adam Beneschan
2011-01-28 17:21         ` Dmitry A. Kazakov
2011-01-29  0:12           ` Randy Brukardt
2011-01-29  8:47             ` Dmitry A. Kazakov
2011-01-28 17:33         ` Adam Beneschan
2011-01-28 15:13     ` Maciej Sobczak
2011-01-28 17:47       ` Robert A Duff
2011-01-28 22:04         ` Maciej Sobczak
2011-01-30 20:22           ` Stephen Leake
2011-01-31  9:04             ` AdaCore, user community and communication channels Maciej Sobczak
2011-01-31 10:42               ` Georg Bauhaus
2011-01-27 19:33 ` Equivalent of dynamic_cast (downcast) for tagged types Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox