NOTE:

These are a little sketchy...I'll fill in details 'soon'.

General Comparison

Comparison Operators

don't forget that there are 5 versions of each operator:

    String  op String
    String  op Cstring
    String  op char
    Cstring op String
    char    op String

(just like above for compare)

Equality

Less Than

Greater Than

Inequality

whichever way you go above, this is almost always:

    bool String::operator!=(const String & right) const
    {
        return !(*this == right);
    }

reusing the == definition and logically negating the results. This isn't terribly efficient, but it does work and saves programmer time and debugging effort.

and so on through the Cstring and char versions.

Greater Than or Equal To

Less Than or Equal To

likewise with these two:

    bool String::operator>=(const String & right) const
    {
        return !(*this < right);
    }

    bool String::operator<=(const String & right) const
    {
        return !(*this > right);
    }

and so on through the Cstring and char versions. (But you do still need 5 versions of each operator!!!)