//******************************************************** // The following code example is taken from the book // C++23 - The Complete Guide // by Nicolai M. Josuttis (www.josuttis.com) // http://www.cppstd23.com // // The code is licensed under a // Creative Commons Attribution 4.0 International License // http://creativecommons.org/licenses/by/4.0/ //******************************************************** #include template void foo(const T1&, const T2&) { std::cout << "different types\n"; } template void foo(const T&, const T&) { std::cout << "same type\n"; } int main() { int arr1[3] {}; int arr2[5] {}; foo(arr1, arr2); // two array of different size passed foo(auto(arr1), auto(arr2)); // two pointers of same type passed }