| 12 | } |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | const int small_int {10}; |
| 17 | std::cout << "Larger of " << small_int << " and 9.6 is " |
| 18 | << larger(small_int, 9.6) << std::endl; // deduced return type: double |
| 19 | |
| 20 | const std::string a_string {"A"}; |
| 21 | std::cout << "Larger of \"" << a_string << "\" and \"Z\" is \"" |
| 22 | << larger(a_string, "Z") << '"' << std::endl; // deduced return type: std::string |
| 23 | |
| 24 | const std::vector v1{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; |
| 25 | const std::vector v2{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 11 }; |
| 26 | std::cout << "The larger of our two vectors ends with " << larger(v1, v2).back(); |
| 27 | } |
| 28 | |