title: how to compare all elements in list using unique() c++
body: <p>I need delete all same words(words are the same if they start with the same letter) 
  My compare function does next:</p>
  
  <pre><code>H  J
  J  H
  H  I
  </code></pre>
  
  <p>Therefore, I need each letter to be compared with the other</p>
  
  <pre><code> bool compare(string a, string b) {
          cout &lt;&lt; a.front() &lt;&lt; "  " &lt;&lt; b.front() &lt;&lt; endl;
          return(a.front() == b.front());
      }
      void Fifth_task(list &lt;string&gt;&amp; lst) {
          list &lt;string&gt; ::iterator it;
          lst.unique(compare);
          for (it = lst.begin(); it != lst.end(); ++it) {
              cout &lt;&lt; *it &lt;&lt; endl;
          }
      }
  
  
      int main(){
      list &lt;string&gt; first;
      first.push_back("Hello");
      first.push_back("Johnny");
      first.push_back("Hello");
      first.push_back("Ildar");
      Fifth_task(first);
      return 0;
      }
  </code></pre>
  
  <p>in the end i should get 3 words : Hello , Johnny, Ildar
  How can i do it?</p>