A
Active8
I have an STL vector I pass to a function and I need to know what
type data is in the vector when I'm in the fuction.
class MyClass
{
template class<T>
int Myfunc(T&){int i = sizeof(T);// oops - I want sizeof(float) }
};
vector<float> vec;
MyClass mc;
mc.Myfunc(vec)
Is there any way to do this without writing separate functions for
each type of data the vector might contain? And without a 2
parameter template *class* like "template class<V, T>" ?
Thanks in advance.
type data is in the vector when I'm in the fuction.
class MyClass
{
template class<T>
int Myfunc(T&){int i = sizeof(T);// oops - I want sizeof(float) }
};
vector<float> vec;
MyClass mc;
mc.Myfunc(vec)
Is there any way to do this without writing separate functions for
each type of data the vector might contain? And without a 2
parameter template *class* like "template class<V, T>" ?
Thanks in advance.