You generally design the signature. Some are unary and some are binary (or either), but you pick the argument types as well as return value.
The increment and decrement ones (++ and --) have a hack whereby an extra dummy argument of type int indicates "this is postfix" and isn't actually an argument which is making the operator binary! The argument isn't given a name.
Anyone halfway knowledgeable in C++ can be expected to know this piece of trivia, IMHO.
It's a huge hack, but the argument that it's something hard to remember that you have to Google for doesn't hold water.
So basically you agree with the the fact that it's a hack, but feel that it's necessary to attack me personally (with a well placed "ad hominem" fallacy) for not being able to remember such trivia.
Let's make this clear: this isn't a test on how well you know C++. It's a rhetorical question, aimed at people how don't know C++, or only have a basic idea of how operator overloading works. Would they be able to guess which is overloaded how? No. Because it's an unintuitive hack.
That's the purpose of the question.
> Anyone halfway knowledgeable in C++ can be expected to know this piece of trivia, IMHO.
You can have your "humble" opinion (first one so far). I'll just have to humbly disagree with it.
I disagree. Let me put it this way: You will not increase the quality of your C++ programmer hires by quizzing them on whether they know whether prefix or postfix gets the extra argument, or even how to overload those operators at all.
If someone put C++ on their resume but doesn't know how to overload operators, they are failing on honesty.
As far as litmus tests of "reasonable competence" in C++ go, "having the signature of every overloaded operator memorized" is among the worst I can possibly think of.
> If you don't care about overloading ++ or making it postfix, you don't have to be aware that there is an int hack for this.
... And it's still a hack.