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
[intro.defs] Should the definition of 'signature' explicitly exclude default template arguments? #1702
Comments
Since the default template argument isn't always present (and may not even be declared in some translation units where the function template is declared) it would not make sense for it to be part of the signature. Otherwise the signature for the same function template would be different in different translation units. |
@jwakely , you seem to agree we need to be more precise than just saying template-head in the definition of signature?. |
It's not clear to me how intentional that is. For function templates, we have [dcl.fct.default]p4: "For a given inline function defined in different translation units, the accumulated sets of default arguments at the end of the translation units shall be the same; see 6.2." ... which seems to suggest that someone at some point thought that the ODR implied this requirement. (And if so, presumably it would also imply a similar requirement on default template arguments.) |
Editorial meeting consensus: Add "excluding default template arguments" in parens everywhere we refer to template-head in a definition of signature would be fine. |
The definition of 'signature' for function template in N4687 [defns.signature.templ] says:
It could be read to mean that default template arguments, which are declared in the template-head, are part of the signature.
Should the standard somehow clarify that default template arguments are not included in the signature?
The text was updated successfully, but these errors were encountered: