I have been trying to override the += sign, and am getting into all sorts of compiling errors. Here is the syntax I am using:
struct my_strcut
{
public:
my_strcut& operator += (my_struct&);
.
.
.
private:
.
.
.
}
When I try to compile a program that includes this, I get the error "binary 'operator +=' has too few parameters". Should I be passing it an additional instance of my_struct?
The only reason I'm passing it just one parameter is becauise the use of this function is very similar to that of the '=' operator, and that one takes only one parameter.
Thanx!
struct my_strcut
{
public:
my_strcut& operator += (my_struct&);
.
.
.
private:
.
.
.
}
When I try to compile a program that includes this, I get the error "binary 'operator +=' has too few parameters". Should I be passing it an additional instance of my_struct?
The only reason I'm passing it just one parameter is becauise the use of this function is very similar to that of the '=' operator, and that one takes only one parameter.
Thanx!