From: "Alex R. Mosteo" <alejandro@mosteo.invalid>
Subject: Re: Ada classwide copy vs C++ clone
Date: Thu, 07 Jul 2011 16:55:31 +0200
Date: 2011-07-07T16:55:31+02:00 [thread overview]
Message-ID: <iv4hd6$c3q$1@dont-email.me> (raw)
In-Reply-To: 185c1b11-6de8-49bf-9d77-8b4855cf2e76@v10g2000yqn.googlegroups.com
Maciej Sobczak wrote:
> 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.
Thanks for the confirmation, I'll try to think of alternatives.
> 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.
I'm already doing this, but good reminder.
Alex.
>
> --
> Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com
prev parent reply other threads:[~2011-07-07 14:55 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
2011-07-07 14:55 ` Alex R. Mosteo [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox