4 Answers
New Answerunary operators are ! + - for most languages such as !true, +5, -4. Operator overloading allows you to make operators have a method of your class. I have a full set of operator overloading examples for each language that runs here and supports it. Since your taking C++ to the point you might understand it, I'll link my version. The comments will get you to all the others. https://code.sololearn.com/cStdw0OPtPxG
Line 28 declares my unary + operator, lines 118 to 121 gives it's implementation, and line 200 makes use of it.
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message