All the examples create their own data type since this is one of the rules for operator overloading: An overloaded operator must work on at least one user-defined type.
Even if you could overload ++ for integers, the compiler wouldn't know which one to use -- your version or the regular version; it would be ambiguous.
You seem to think of operators as single functions, but each overload is a completely separate function differentiated by its function signature (type and sometimes number of arguments), while having the same operator symbol (this is the definition of "overloading").
So, you can't overload ++ to always do something different; this would really be operator overriding, which C++ doesn't allow.
You can define ++ for a type you've created though:
class MyType {
public:
int value;
};
MyType const& operator++(MyType& m) { // Prefix
++m.value;
return m;
}
const MyType operator++(MyType& m, int) { // Postfix (the 'int' is just to differentiate it from the prefix version)
MyType temp = m;
++m.value;
return temp;
}
int main() {
MyType m;
m.value = 0;
m++; // Not m.value++
cout << m.value; // Prints 1
}
Note that this set of ++ operators was defined outside of the MyType class, but could have been defined inside instead (they would gain access to non-public members that way), though their implementations would be a little different.