From http://www.parashift.com/c++-faq-lite/intrinsic-types.html
Can I define an operator overload that works with built-in / intrinsic / primitive types?
No, the C++ language requires that
your operator overloads take at least
one operand of a "class type" or
enumeration type. The C++ language
will not let you define an operator
all of whose operands / parameters are
of primitive types.
For example, you can't define an
operator== that takes two char*s and
uses string comparison. That's good
news because if s1 and s2 are of type
char*, the expression s1 == s2 already
has a well defined meaning: it
compares the two pointers, not the two
strings pointed to by those pointers.
You shouldn't use pointers anyway. Use
std::string instead of char*.
If C++ let you redefine the meaning of
operators on built-in types, you
wouldn't ever know what 1 + 1 is: it
would depend on which headers got
included and whether one of those
headers redefined addition to mean,
for example, subtraction.
C++ Standard §13.5.6
An operator function shall either be a non-static member function or be a non-member function and have at least one parameter whose type is a class, a reference to a class, an enumeration, or a reference to an enumeration. It is not possible to change the precedence, grouping, or number of operands of operators. The meaning of the operators =, (unary) &, and , (comma), predefined for each type, can be changed for specific class and enumeration types by defining operator functions that implement these operators. Operator functions are inherited in the same manner as other base class functions.