Hi everyone,
At the moment I'm trying to create a class that contains a DOMNode* pointer, something like this
class MyDOMNode
{
public:
MyDOMNode (DOMNode* node)
: mDomNode (node)
{
}
bool operator== (const MyDOMNode& rhs)
{
if (mDomNode == rhs.mDomNode)
return true;
return false;
}
bool operator!= (const MyDOMNode& rhs)
{
return !(mDomNode == rhs.mDomNode);
}
private:
DOMNode* mDomNode;
};
What I'm trying to do in the main program is this
MyDomNode node = ...
while (node != 0)
{
do stuff
}
However when I try to compile I'm getting an error "no match for operator !=" in "node != 0"... would I need to create additional != and == functions to accept an int value and check this against the pointer in the class? Or am I doing this completely wrong :S
Any help is much appreciated,
Stephen