M
mosfet
Hi
I would like to write a template method, something like :
template <typename Type>
int MyClass::_Foo(vector<Type> MyVec)
{
if (int type)
.....
if (long type)
.....
return 0;
}
and be able to call it like this
vector<int> VecInt;
vector<long> VecLong;
_Foo(VecInt);
_Foo(VecLong);
But my question is how do I know inside the template what type is passed
(int or long)
Thanks
I would like to write a template method, something like :
template <typename Type>
int MyClass::_Foo(vector<Type> MyVec)
{
if (int type)
.....
if (long type)
.....
return 0;
}
and be able to call it like this
vector<int> VecInt;
vector<long> VecLong;
_Foo(VecInt);
_Foo(VecLong);
But my question is how do I know inside the template what type is passed
(int or long)
Thanks