-
Notifications
You must be signed in to change notification settings - Fork 784
Description
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)