using std::find on a container of a user-defined type c++
<p>Im trying to write a search function to get an element in std::list by suing std:find. But im stuck in the third parameter in the find argorithm, regard to this guy <a href="http://stackoverflow.com/questions/4604136/how-to-search-for-an-element-in-an-stl-list?answertab=active#tab-top">How to search for an element in an stl list?</a> I did overload the operator == pretty much but it seems still not working with the std::find.</p>

<p>This is my code:</p>

<pre><code>class Node
{
    string word;
    int count;

    public:
        Node(string _word) :word(_word), count(0) {}
        ~Node() {}

        const string&amp; getWord() const{
            return word;
        }
        bool operator == (const Node&amp; other) const {
            return (this-&gt;word.compare(other.word) == 0);
        }
};
const Node &amp;getNode(const list&lt;Node&gt; &amp;nodes, const string &amp;word){
    list&lt;Node&gt;::iterator itr;
    itr = find(nodes.begin(), nodes.end(), new Node(word)); &lt;-- no viable overload '='
    return *itr;
}
</code></pre>

<p>I'm going very crazy with that issue now, please suggest me some hints. Thanks</p>
