This can sometimes happen when copy pasting code from the web. Somehow you have got some invalid/invisible characters that you can't see but the compiler complain about them.
What happens if you copy paste your operator!= code from your post here, does that work? Otherwise just remove the whole operator!= code and make sure you don't have any stray '\xxx' errors and then retype the code by hand.