The return value of your operators does not need to be const. It doesn't harm the issue, but is unnecessary. The operator itself should be a const function. The parameter needs to be a const reference. For example

You are returning "const go" from each of your operators. The operators themself take non-const reference, so this won't work. Returning by const value is useless anyway, just return "go". Also you should/need to define the input paramter to be "const go&".

EDIT: Damn, to slow ;)

EDIT2: Out of interest, did you really understand what you've been told that last thread you asked about the "temporary const return value"-thingy? Because this is pretty much related to this question...

EDIT3:

Solved: define the operator overloaded functions as global,but make them a friend to the class.That way,you can get your hands on both operands!

Thats utterly ugly. You shouldn't do that, declare the functions properly like described by me BitMaster, don't relate to such "hack-arounds" for simple things as operator overloading.

Solved: define the operator overloaded functions as global,but make them a friend to the class.That way,you can get your hands on both operands!

There are sometimes valid reasons for friend functions instead of member function. Not understanding essential and basic things like constness and parameter passing is not one of them though. Sorry for sounding blunt, but you really need a lot of more knowledge and experience before you should decide to do a "Solved" in obnoxious font sizes.