Code bloats cause by template

On some platform, int* and double* and other T* type share the same object code
Some linkers would kill the redundancy part for us, some may not

Is most of the compilers of today mature enough to handle that kind of problem?
Thanks a lot
On some platform, int* and double* and other T* type share the same object code
Certain aspects, but not all. For example, pointer arithmetic will be different.
dereferencing would be different too
pointer arithmetic

like this?
1
2
3
4
5
6
7
8
9
//assume p is something like T *p;
++p; 
p++; 
--p; 
p--;
p += 10;
p -= 10;
p = p + 10;
p = p - 10;

Thanks a lot
Yes, those expressions have values (addresses in memory) which are dependent on the type.
So the point to discern what may generate the same object code is base on
"what is void* can do" and "what is void* can't do"?
the operation void* can't do would not generate same object code since they need
the information of type
Topic archived. No new replies allowed.