You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whether an explicit specialization of a function or variable template is inline, constexpr, constinit, or consteval is determined by the explicit specialization and is independent of those properties of the template.
Similarly, attributes appearing in the declaration of a template have no effect on an explicit specialization of that template.
First of all, I don't like the wording, because it is not very clear that the consteval wording doesn't apply to variable templates. This should probably use "constexpr function", "inline function", "immediate function", and other clearly defined terms.
Secondly, "constexpr variable" is not defined, and this paragraph makes mention of it indirectly. See also #6521. It should say "constexpr variable" with proper formatting, or "constexpr variable" should be defined.
Thirdly, shouldn't this paragraph apply to member templates too? How come this only applies to function templates, and not member function templates? How come this does not apply to templates of static data members?
The text was updated successfully, but these errors were encountered:
What this says is that the listed keywords on the template declaration have no bearing on an explicit specialization. I think that's clear enough.
I note that a member function is also a function, and a member function template is also a function template. Further, a static data member is a variable.
What this says is that the listed keywords on the template declaration have no bearing on an explicit specialization. I think that's clear enough.
I note that a member function is also a function, and a member function template is also a function template. Further, a static data member is a variable.
I'm not seeing a problem here.
I think you're right, and such a note could be good. It's just that I've seen a lot of wording that mentions member function templates explicitly, so I've assumed that "function template" is not so all-encompassing.
Still, "constexpr variable" is not defined, and that's worth looking into because wording exists which acts as if it was defined.
I've seen a lot of wording that mentions member function templates explicitly
Sure, but that is specific for member function templates (excluding non-member function templates). It would be bothersome if there was wording that said "function template and member function template", because that's redundant and gives the impression that the former doesn't include the latter. Specific examples welcome.
The paragraph [temp.expl.spec] p13 says:
First of all, I don't like the wording, because it is not very clear that the
consteval
wording doesn't apply to variable templates. This should probably use "constexpr function", "inline function", "immediate function", and other clearly defined terms.Secondly, "constexpr variable" is not defined, and this paragraph makes mention of it indirectly. See also #6521. It should say "
constexpr
variable" with proper formatting, or "constexpr variable" should be defined.Thirdly, shouldn't this paragraph apply to member templates too? How come this only applies to function templates, and not member function templates? How come this does not apply to templates of static data members?
The text was updated successfully, but these errors were encountered: