I have two pointers. p1. p2.
p1 and p2 both point to different classes.
The classes have some similar method names,
and I'd like to call a template function twice to avoid repeated code.
Here is my function:
template <class T>
void Function(vector<T> & list, T* item, const string & itemName)
see that middle paramater, "item".. is that how my signature should look if I want the item changed?
..or should I pass it as
T* & item
..or should I pass it as
T** item
the compiler is letting a lot of things slide, but then when I go to bind everything it breaks.
How do I call that function using one of my pointers?
something about casting?? I've tried everything :\