unary operator overloading in c++ sample questions code example
Example: unary overload operator cpp
class A {
public:
int value;
A(int v1) : value(v1) {};
// overloaded minus (-) operator
A operator- () {
return A(-value);
};
};