number of vector template instances and pointers

Yves Rutschle y.rutschle@indigovision.com
Mon Sep 20 10:21:00 GMT 2004


On Mon, Sep 20, 2004 at 12:13:47PM +0200, Fery wrote:
> When I create two vectors with different pointer types (e.g.
> vector<char*> and vector<int*>), gcc compiles in two instances of vector
> code. In SH architecture, it means cca. n * 10K of code, which is quite
> big in our project.
> 
> The question is, can I somehow force the compiler to use the same code
> for the two template instances?

Considering the way C++ templates work, most likely not. C++
templates are an horror in terms of implementation (and in
terms of usage. and in... erm, ok I don't like them).

Going further, I'd also tend to say that if space is at a
premium, C++ isn't what you need either...

Y.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list