I have a class Samp. In Samp.cpp, I can define/declare a function like
Samp& operator+(Samp& other) {
std::cout << "something";
return other;
}
What is this function exactly? How do I call it?
This is actually a unary +
, you call it like this:
Samp s;
+s; // <-- here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With