Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-08-12 13:22:01


John Maddock wrote:
> The difference is that C++ lets you spot the duplication: for example if you
> discover that your application is using vector<int>, vector<unsigned>,
> vector<long> and vector<heaven-knows-what-else> then you should definately
> be asking why they can't all be using the same instantiation!

Just a curiosity, Digginig in the Freescale/MSL STL implementation we
use at job I've seen an space optimization MACRO (I don't know if it's
activated by default or not) where all vectors of POD types of the same
size where treated with a single type type (just the same trick as
vector<void*> but with ints, shorts, and similar POD types). I suppose
that option was there because the compiler was not smart enough to
optimize them (I don't know if that's true nowadays).

Regards,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk