Using function overloading, note how similar each of the swap functions would be The three places where the type is specified What if we passed the type somehow? Templates make this possible Declare functions that receive both data and types via parameter Thus code becomes more generic Easier to reuse and extend to other types COMP 152▪ Using function overloading, note how similar each of the swap functions would be • The three places where the type is specified ▪ What if we passed the type somehow? ▪ Templates make this possible • Declare functions that receive both data and types via parameter ▪ Thus code becomes more generic • Easier to reuse and extend to other types COMP152 7