4

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

It's a question from C++ Primer 5th Edition that I'm reading.

Also from the book :

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

From another thread on SO :

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

Just confirming, is 256 the answer to this question?

Community
  • 1
  • 1
Yue Wang
  • 1,710
  • 3
  • 18
  • 43

1 Answers1

2

Not really. Both can have at least 256 ones.

It has been cleared discussed on 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].

Community
  • 1
  • 1
herohuyongtao
  • 49,413
  • 29
  • 133
  • 174
  • If so, I'm gonna delete this post. But I think that thread only talks about functions rather than overloaded function-call operator. Do you mean they are the same thing? – Yue Wang Jan 19 '14 at 01:08
  • 2
    @Alan.W They are the same, both are functions. – herohuyongtao Jan 19 '14 at 01:12
  • @Alan.W: No need to delete the question. I can't find a duplicate, and it meets all the requirements for an SO question. – MSalters Jan 19 '14 at 01:26