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

Comments

@tcflanagan
Copy link

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
Copy link
Owner

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"

kruschk pushed a commit to kruschk/ccc that referenced this issue Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants