title: C++, find_if not working
body: <p>I am using for the first time std::find_if function in C++ code. The examples and the logic I want to execute are pretty simple but somehow I cannot make it work.</p>
  
  <p>I have created the "finder" class this way:</p>
  
  <pre><code>  /**
    * @class message_by_id_finder
    * @brief A class to find the matching lane wrapper
    */
    class message_by_id_finder
    {
    public:
    /** @brief constructor */
    explicit message_by_id_finder(int id) :
    m_myMessage(id) {
    }
  
    /** @brief the comparing function */
    bool operator()(const AppMessage&amp; message) const {
    return message.messageId == m_myMessage;
    }
  
    private:
    /// @brief The id of the searched object
    int m_myMessage;
    };
  </code></pre>
  
  <p>Then I use it the following way:   </p>
  
  <pre><code> // Loop messages 
  for (vector&lt;AppMessage&gt;::iterator it = messages.begin(); it != messages.end() ; ++it ) {
  // Match message with the registered by the App
  AppMessage m = *it;
  vector&lt;AppMessage&gt;::iterator it2 = find_if(m_messages.begin(), m_messages.end(), message_by_id_finder(m));
  if (it2 != m_messages.end()) {
    // FOUND!
  } else {
    // NOT FOUND
  }
  } 
  </code></pre>
  
  <p>I looped the m_messages vector and there are members that match the id but it2 is always 0x00. Am I doing something particulary wrong?</p>
  
  <p>Thank you very much in advance.</p>
  
  <p>PD: Just in case, other piece of codes useful to understand the problem:</p>
  
  <pre><code>  /**
    * @struct AppMessage
    * @brief Information of a message carrying a result of the App.
    */
    struct AppMessage {
        int messageId;      
        float payloadValue;    
    };
  </code></pre>