Re: Containers of iterators vs. containers of references
On Jan 25, 2:41 am, "Jeff F" <fli...@chartermi.net> wrote:
<clark.cole...@att.net> wrote in message
news:b1a5fa6d-0f6e-418b-b13c-560c1d2709c9@l32g2000hse.googlegroups.com...
You can't have a container of references; references aren't
objects. I would use a container of pointers, however.
Any recommendations for type of pointer? I started playing with
shared_ptr but then I discovered that Visual Studio does not yet
support C++ TR1. I need the code to run on both x86/Linux under g++
and Visual Studio.
Use the shared_ptr fromwww.boost.org, which is the basis for
TR1, and supports both of those compilers along with many
others.
Better yet see the boost graph library which more directly
supports your application.
Looking at his application: he certainly doesn't want
shared_ptr, since there will be cycles---and in this case, using
weak_ptr to break them will be fairly complicated. I'm not
familiar with the Boost graph library, to know whether it's
appropriate, but if not, raw pointers would seem to be the way
to go.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34