title: C++ STL set custom comparator
body: <p>I have a problem in ordering a set of string by custom comparator.
  I would order according to string length.</p>
  
  <pre><code>struct CompareLenght
  {
      bool operator()(const std::string s1, const std::string s2) const
      {return (s1.size()&gt;s2.size());}        
  }
  
  class SearchEngine
  {
      private:
      void Associate(const std::vector&lt;std::string&gt; &amp;Files);
      public:   
      SearchEngine(const std::vector&lt;std::string&gt; &amp;Files);  
      void Search(const std::string &amp;frase, std::set&lt;std::string&gt; *S);
  };
  
  class FindWord
  {
      private:
      std::set&lt;std::string&gt; Parole_Univoche; 
      public:  
  
      FindWord(const std::string &amp;str);
      inline void Get_Word(std::set&lt;std::string&gt; *Set_Of_Word); 
  };
  
  inline void FindWord::Get_Word(std::set&lt;std::string&gt; *Set_Of_Word)
  {  
      *Set_Of_Word = Parole_Univoche;
  }
  </code></pre>
  
  <p>The problem comes when I try to do that:</p>
  
  <pre><code>void SearchEngine::Search(const std::string &amp;phrase, std::set&lt;std::string&gt; *S)
  {
      FindWord F(phrase);                             
      std::set&lt;std::string,CompareLenght&gt; Keyword;             
      F.Get_Word(&amp;Keyword);   
      // some code
  }
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>In file included from main.cc:15:0:
  SearchEngineNew.cc: In member function ‘void SearchEngine::Search(const string&amp;, std::set&lt;std::basic_string&lt;char&gt; &gt;*)’:
  SearchEngineNew.cc:69:33: error: no matching function for call to ‘FindWord::Get_Word(std::set&lt;std::basic_string&lt;char&gt;, cmp&gt;*)’
                F.Get_Word(&amp;Keyword);       
                                   ^
  SearchEngineNew.cc:69:33: note: candidate is:
  In file included from main.cc:14:0:
  FindWord.cc:39:13: note: void FindWord::Get_Word(std::set&lt;std::basic_string&lt;char&gt; &gt;*)
   inline void FindWord::Get_Word(std::set&lt;std::string&gt; *Set_Of_Word)
               ^
  FindWord.cc:39:13: note:   no known conversion for argument 1 from ‘std::set&lt;std::basic_string&lt;char&gt;, cmp&gt;*’ to ‘std::set&lt;std::basic_string&lt;char&gt; &gt;*’
  </code></pre>
  
  <p>How can solve this problem?
  Thank you very much!</p>