overloaded operator operator< in my class is not being used by STL max_element
<p>I have a vector of pointers to objects QActionDonald and I'm trying to find the object containing the highest expectedvalue_.  I have overloaded the operator&lt; and I'm using the max_element method to obtain an iterator to the highest value but i always receive the end value which is not correct.<br>
QActionDonald.h:</p>

<pre><code>class QActionDonald
{
public:

double expectedvalue_;

bool operator &lt; (const QActionDonald&amp; other) const;

}; 
</code></pre>

<p>QActionDonald.cpp:</p>

<pre><code>bool QActionDonald::operator&lt; (const QActionDonald&amp; other) const
{
    return expectedvalue_ &lt; other.expectedvalue_;
}
</code></pre>

<p>otherClass:</p>

<pre><code>std::vector&lt;QActionDonald*&gt; *actionList =  qValueDictionary[stateKey];

        std::vector&lt;QActionDonald*&gt;::iterator it = 
std::max_element(actionList-&gt;begin(), actionList-&gt;end());
</code></pre>
