[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (OT) Re: memory management



Ingo Ruhnke wrote:

> > I'm not sure why templates would be harder to debug and maintain
> > than a tenfold implementation of the same functionality, once for
> > integers, once for class Foo, class Bar, char* etc :^)
> 
> Yep agree, how should vector<> and friends be implemented without
> templates?

I don't know why, but the idea of a common superclass (like the Object
class in Java) doesn't occur too much with C++ programmers... Ok, the
native types can't be put in one, but that's life (and if they HAVE to,
you can wrap them in objects).

The only *real* use of vector that I'd see would be a vector of a
massive number of real objects (not pointers to objects) that have to be
handled in a fast manner, like a list of vertices for a 3D scene.

-- 
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
"First they ignore you. Then they laugh at you.
Then they fight you. Then you win." -- Gandhi