Assuming I have a function in the following form,
template<typename T>
int some_call(T t){
return t;
}
Is is possible to in compile time build a list of typenames and find the largest T used. i.e,
some_call(int(42));
some_call(long(42));
I would like to find sizeof(long) since it is largest size used. The reason I am trying to do is I will allocate an array to hold some memory for a calculation I would like to allocate big enough to hold largest type.
Aucun commentaire:
Enregistrer un commentaire