Help with a function that accepts different parameter types
take a look at: http://www.cplusplus.com/doc/tutorial/functions2/

template &lt;typename SomeType&gt;
SomeType sum (SomeType a, SomeType b)
{
  return a+b;
}


This appears to be what you want.