c – 重载函数调用运算符可以使用多少个操作数?

Exercise 14.33: How many operands may an overloaded function-call
operator take?

这是我正在阅读的C Primer第5版的问题.

也来自这本书:

An overloaded operator function has the same number of parameters as
the operator has operands.(Section 14.1)

another thread on SO开始:

— Parameters in one function definition [256]. 
— Arguments in one function call [256]. 

刚刚确认,这个问题的答案是256吗?

最佳答案 并不是的.两者都至少有256个.

已经在Maximum number of parameters in function declaration讨论过了.

The limits may constrain quantities that include those described below or others. The bracketed number following each quantity is recommended as the minimum for that quantity. However, these quantities are only guidelines and do not determine compliance.

— Parameters in one function definition [256].

— Arguments in one function call [256].

点赞