diff --git a/ch16/README.md b/ch16/README.md index 789de7ba..7aae1349 100644 --- a/ch16/README.md +++ b/ch16/README.md @@ -335,7 +335,12 @@ Then, the answers: > The library `max` function has two function parameters and returns the larger of its arguments. This function has one template type parameter. Could you call `max` passing it an int and a double? If so, how? If not, why not? -No, I could not. Because the arguments to `max` must have the same type. +Yes. Specify the parameter explicitly: +> ```cpp +> int a = 6; double b = 6.1231; +> max(a, b); +> ``` +> Normal conversions also apply for arguments whose template type parameter is explicitly specified ## Exercise 16.38 @@ -429,4 +434,4 @@ Since C++11, [`std::allocator::construct`](http://en.cppreference.com/w/cpp/memo > Write your own version of the flip function and test it by calling functions that have lvalue and rvalue reference parameters. -[flip and test](ex16_47_flip.cpp) \ No newline at end of file +[flip and test](ex16_47_flip.cpp)