comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Using Class wide types as factories, is this legit?
Date: Tue, 23 Sep 2014 09:23:32 +0200
Date: 2014-09-23T09:23:32+02:00	[thread overview]
Message-ID: <14aahny7n1xxq.12aqg1nr0sro0$.dlg@40tude.net> (raw)
In-Reply-To: 4b9c517f-9c78-44f5-bda1-8e7647f06851@googlegroups.com

On Mon, 22 Sep 2014 22:19:32 -0700 (PDT), David Botton wrote:

> I have a pattern I have used in the past to make Classwides act as factories for objects.

Why not to pass a factory object instead?

> This worked in versions of GNAT about a year and a half ago. Is this a
> compiler bug or bad Ada?

It is hard to say without seeing Initialize, Finalize and Adjust. I would
guess that Adjust is wrong, e.g. not making a deep copy of the things
killed in Finalize, which may lead to deallocating these twice in the first
variant of your code.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2014-09-23  7:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23  5:19 Using Class wide types as factories, is this legit? David Botton
2014-09-23  7:23 ` Dmitry A. Kazakov [this message]
2014-09-23  8:21   ` David Botton
2014-09-23 19:28     ` Dmitry A. Kazakov
2014-09-23 21:27       ` David Botton
2014-09-24  7:22         ` Dmitry A. Kazakov
2014-09-23  8:37   ` briot.emmanuel
2014-09-23  8:52     ` David Botton
replies disabled

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