Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page 159: Apparent contradiction between text and Listing 6-13 #85

Closed
tcflanagan opened this issue Jan 1, 2020 · 1 comment
Closed

Page 159: Apparent contradiction between text and Listing 6-13 #85

tcflanagan opened this issue Jan 1, 2020 · 1 comment

Comments

@tcflanagan
Copy link

@tcflanagan tcflanagan commented Jan 1, 2020

The text on p. 159 states, "...if a template function's return type is a template argument, you must specify template arguments explicitly."

In Listing 6-13, the function mean returns type T, a template argument. Yet in main(), the calls to mean do not specify any template arguments. The listing compiles and runs correctly, so the text contains either an error or an ambiguity in the use of the phrase "template argument."

@JLospinoso

This comment has been minimized.

Copy link
Owner

@JLospinoso JLospinoso commented Jan 1, 2020

Thanks @tcflanagan! I see how this could be very confusing. I've added the qualifier "if a template function’s return type is a template argument that's entirely independent of other function and template arguments"

@JLospinoso JLospinoso closed this in 56500f0 Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.