Boost logo

Boost Users :

From: Chris Uzdavinis (cuzdav_at_[hidden])
Date: 2007-04-16 19:26:26


On 4/16/07, Bill Buklis <boostuser_at_[hidden]> wrote:
> Internally, the ptr_container classes use a void* container to do its magic.
...
> I'm just curious as to why you didn't use the more obvious (and perhaps
> wrong) choice of vector<T*>. Note: I'm not suggesting that it be changed.

I think the main reason is to reduce code bloat. Instead of having to
instantiate N vectors for different pointer types , the compiler can
re-use a single instantiation of of vector<void *>. A good compiler
might be able to optimize this anyway, but the world is full of
sub-optimal compilers, and this is a fairly simple, pragmatic
solution.

Chris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net