No it's nothing to do with whether the variables or operator function is global. You can only overload operators for types you create yourself (with classes), you can't overload for int's alone otherwise the compiler doesn't know whether to use your overloaded operator or the built in one.