On Fri, 20 Oct 2000, Angus Leeming wrote:

> On Fri, 20 Oct 2000, Jean-Marc Lasgouttes wrote:
> > >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> >
> > Angus> Things are always copied on return. That's why things like
> > Angus> reference counters were invented; the main class holds just a
> > Angus> pointer that points to the data structure. Only the pointer is
> > Angus> then copied on return.
> >
> > And is the vector class reference-counted? I guess the answer is no...
> 
> Well, this is a case of the blind leading the blind... the C++ gurus will 
> know, but I'm pretty sure that <string> is referenced counted. My guess is 
> that all STL containers are.

The std:string should use reference counting, but I dont think its
mandated by the standard. The other STL containers (vector, map, hash and
so on) are not reference counted to the best of my knowledge. At least
they are not mandated to be reference counted.

The problem with reference counting is that there are a lot of conflicting
compromises that might be needed, a major hurdle is when working in a
multitasking environment. In fact multitasking environment and the generic
algorithms and the various idioms cause problems and need a thorough
consideration.

The STL standard mandates various performance definitions but I believe
that reference counting is not mandated in the STL.

This is from memory alone, and my memory is not that good :-)

-- 
  Baruch Even

http://techst02.technion.ac.il/~sbaruch/   (My Site)
http://www.redrival.com/jindor/            (My brothers AD&D site)

" Learn to laugh ... it's the path to true love! " 
   - The Angel in the movie Michael



Reply via email to