// // Example of how to use two templates // // Week 2, lecture 2.2 // #include using namespace std; #include // // Pay attention on the safe casting 'static_cast' // /* . More types means worrying about convertions and more signatures . static_cast operators are considered safe . The old cast operator (type) is deprecated */ template void copy(const T1 source[], T2 destination[], int size) { for (int i = 0; i < size; ++i) destination[i] = static_cast(source[i]); } template T display(T data[], int size) { for (int i = 0; i