I have a class called AString
. It is pretty basic:
class AString
{
public:
AString(const char *pSetString = NULL);
~AString();
bool
[ Original answer was wrong and thus corrected below ]
As pointed out by Oli Charlesworth, in a comment below, this is impossible.
You would need to define an operator like
bool operator==(const AString *as, const char *cs); // Note: C++ will not do that
but you cannot overload an operator unless one of its parameters is non-primitive type - and pointers (both pointers to AString and pointers to char) are primitive types.