comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Ada classwide copy vs C++ clone
Date: Wed, 6 Jul 2011 14:00:17 -0700 (PDT)
Date: 2011-07-06T14:00:17-07:00	[thread overview]
Message-ID: <185c1b11-6de8-49bf-9d77-8b4855cf2e76@v10g2000yqn.googlegroups.com> (raw)
In-Reply-To: iv22if$9j0$1@dont-email.me

On Jul 6, 6:30 pm, "Alex R. Mosteo" <alejan...@mosteo.invalid> wrote:

> More reading late, my current conclusion is that I need to use the Clone
> pattern and implement a cloning method in every derived class.
>
> So, this is what I'd like to hear confirmed. Am I right?

Yes. This is also why you should *carefully* rethink the requirement
for having this operation in the whole hierarchy. It should not come
up by default.
Also, you will want to use boost::shared_ptr or something similar to
protect yourself from the pointer mess. Raw pointers are to be
avoided, even if pointer-related patterns have to be used.

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



  parent reply	other threads:[~2011-07-06 21:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-06 16:30 [OT] Ada classwide copy vs C++ clone Alex R. Mosteo
2011-07-06 16:44 ` Dmitry A. Kazakov
2011-07-07 14:43   ` Alex R. Mosteo
2011-07-07 16:34     ` Dmitry A. Kazakov
2011-07-06 21:00 ` Maciej Sobczak [this message]
2011-07-07 14:55   ` Alex R. Mosteo
replies disabled

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