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

[over.oper.general] default arguments for operator[] #5131

Closed
jensmaurer opened this issue Nov 30, 2021 · 2 comments · Fixed by #5665
Closed

[over.oper.general] default arguments for operator[] #5131

jensmaurer opened this issue Nov 30, 2021 · 2 comments · Fixed by #5665
Labels
not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Comments

@jensmaurer
Copy link
Member

See P2128R6

In 12.4.1 [over.oper.general], the 10-th clause is stated as follows:

An operator function cannot have default arguments (9.3.4.7), except where explicitly stated below. Operator functions cannot have more or fewer parameters than the number required for the corresponding operator, as described in the rest of 12.4.

I think this clause is why that last clause (12.4.4, [over.call]) need to specify

A function call operator function is a function named operator() that is a non-static member function with an arbitrary number of parameters. It may have default arguments. For an expression of the form

Therefore for consistency between operator() and operator[], and be more clear with specification, I think we should specify It may have default arguments in [over.sub] too.

Originally posted by @Mick235711 in #4997 (comment)

@jensmaurer jensmaurer added after-motions Pull request is to be applied after the pending edits from WG21 straw polls have been applied. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. and removed after-motions Pull request is to be applied after the pending edits from WG21 straw polls have been applied. labels Nov 30, 2021
@jensmaurer
Copy link
Member Author

CWG2507

@frederick-vs-ja
Copy link
Contributor

This should have been fixed by #5665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
2 participants