title: How to use a lambda function with std::replace_if()?
body: <p>I am trying to write a function that will replace a Song in a set if there IDs match.</p>
  
  <p>I am still a bit confused by lambda expressions.</p>
  
  <p>I am trying to use replace_if but I am not sure how to reference the original song in the expression.</p>
  
  <p>m_songs is a set of song objects</p>
  
  <p>I want to replace with whichever song in m_song shares the ID with newSong.</p>
  
  <p>So basically how do I get the ids from m_songs in the replace if statement?</p>
  
  <pre><code>std::replace_if(m_songs.begin(), m_songs.end(),
       newSong.getID() == (One of the m_songs?)getID() , newSong) ;
  </code></pre>