container<POD> refactoring
Matt Austern
austern@apple.com
Mon Sep 20 18:40:00 GMT 2004
On Sep 20, 2004, at 11:22 AM, Joe Buck wrote:
> Has anyone done any thinking about adding specializations for avoiding
> bloat with containers of POD types? For std::vector, it seems that all
> of the out-of-line functions other than the == and < operators depend
> only on the size of the POD, and nothing else.
>
> Just specializing container<T*> would be easier, and a win for some.
> But a complete job might manage to have one copy, in the library, of
> out-of-line code for almost all container<POD> functions that use the
> default allocator.
The last time anyone looked at it (Doug Gregor looked at it a year
ago), specializing container<T*> as a thin wrapper around
container<void*> turned out not to be a good idea. It introduces
some extra layers of function calls, and it turns out that our
optimizer isn't yet smart enough to get rid of them. When our
optimizer gets better, we should rethink that.
--Matt
More information about the Libstdc++
mailing list