Templates must be defined inline in the header file, otherwise the compiler cannot see the definition to instantiate the template with.
you wrote typeid(T)
i dont think that is possible because "T" is just a placeholder for a variable type
template <class T>
T add(T a1, T a2)
where a1 and a2 can be a int, double, char, float or whatever variable type.
so basically typeid(T) is just passing a variable type T
@geosnipes: there is nothing at all wrong with
¿why are you casting?
> a method based on the type passed
return os << obj.getNum();
¿where are you passing the type?