Re: naked pointer vs boost::shared_ptr<T>
On Mar 7, 11:39 pm, "Dejan.Mircev...@gmail.com"
<Dejan.Mircev...@gmail.com> wrote:
On Mar 6, 5:15 am, "James Kanze" <james.ka...@gmail.com> wrote:
Surely you have 1 to n relationships
in your software. How do you manage those? I generally use an
std::set< T* >
OK, this is where I'll agree with you: raw pointers are a suitable
solution when you need an assignable reference to externally owned
memory that may be non-dynamic.
In my case, it must be dynamic, since the lifetime of the
objects pointed to depends on external events. The non-dynamic
is irrelevant.
[...]
Also, I believe this is orthogonal to the question of arbitrary
lifespans.
If the lifespan isn't arbitrary, why allocate the object
dynamically?
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]