class A{
public:
A operator-() const{
A temp;
temp.someData = -std::abs(temp.someData);
return temp;
} // Or you can make a friend operator
friend A operator-(A un){ // You can use a reference instead but then
un.someData = -std::abs(un.someData); // you have to create a
return un; // temporary object.
} // Not a big difference
private:
int someData;
};