title: I am getting errors in the xfunction built in class and i dont know what to do
body: <p>I am creating a map data structure that uses set to hold pair values. I have made a custom pair class for the program. I got through most of the debugging and now i am getting these error in the built in xfunction class. </p>
  
  <p>Error   6   error C2784: 'bool std::operator &lt;(const std::basic_string&lt;_Elem,_Traits,_Alloc> &amp;,const _Elem *)' : could not deduce template argument for 'const std::basic_string&lt;_Elem,_Traits,_Alloc> &amp;' from 'const Pair'    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   7   error C2784: 'bool std::operator &lt;(const _Elem *,const std::basic_string&lt;_Elem,_Traits,_Alloc> &amp;)' : could not deduce template argument for 'const _Elem *' from 'const Pair'  c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   8   error C2784: 'bool std::operator &lt;(const std::basic_string&lt;_Elem,_Traits,_Alloc> &amp;,const std::basic_string&lt;_Elem,_Traits,_Alloc> &amp;)' : could not deduce template argument for 'const std::basic_string&lt;_Elem,_Traits,_Alloc> &amp;' from 'const Pair'  c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   9   error C2784: 'bool std::operator &lt;(const std::move_iterator&lt;_RanIt> &amp;,const std::move_iterator&lt;_RanIt2> &amp;)' : could not deduce template argument for 'const std::move_iterator&lt;_RanIt> &amp;' from 'const Pair'    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   10  error C2784: 'bool std::operator &lt;(const std::_Tree&lt;_Traits> &amp;,const std::_Tree&lt;_Traits> &amp;)' : could not deduce template argument for 'const std::_Tree&lt;_Traits> &amp;' from 'const Pair'  c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   11  error C2784: 'bool std::operator &lt;(const std::list&lt;_Ty,_Ax> &amp;,const std::list&lt;_Ty,_Ax> &amp;)' : could not deduce template argument for 'const std::list&lt;_Ty,_Ax> &amp;' from 'const Pair' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   12  error C2784: 'bool std::operator &lt;(const std::unique_ptr&lt;_Ty,_Dx> &amp;,const std::unique_ptr&lt;_Ty2,_Dx2> &amp;)' : could not deduce template argument for 'const std::unique_ptr&lt;_Ty,_Dx> &amp;' from 'const Pair' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   13  error C2784: 'bool std::operator &lt;(const std::reverse_iterator&lt;_RanIt> &amp;,const std::reverse_iterator&lt;_RanIt2> &amp;)' : could not deduce template argument for 'const std::reverse_iterator&lt;_RanIt> &amp;' from 'const Pair'   c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   14  error C2784: 'bool std::operator &lt;(const std::_Revranit&lt;_RanIt,_Base> &amp;,const std::_Revranit&lt;_RanIt2,_Base2> &amp;)' : could not deduce template argument for 'const std::_Revranit&lt;_RanIt,_Base> &amp;' from 'const Pair' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   15  error C2784: 'bool std::operator &lt;(const std::pair&lt;_Ty1,_Ty2> &amp;,const std::pair&lt;_Ty1,_Ty2> &amp;)' : could not deduce template argument for 'const std::pair&lt;_Ty1,_Ty2> &amp;' from 'const Pair'   c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>Error   16  error C2676: binary '&lt;' : 'const Pair' does not define this operator or a conversion to a type acceptable to the predefined operator   c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional  125</p>
  
  <p>here is my code for map2.h</p>
  
  <pre><code>#ifndef MAP_H_2
  #define MAP_H_2
  #include &lt;list&gt;
  #include &lt;set&gt;
  #include &lt;utility&gt;
  #include &lt;iterator&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  //pair class header
  template&lt;typename F, typename S&gt;
  class Pair
  {
  public:
      Pair(const F&amp; a, const S&amp; b);
      Pair();
      F get_first() const;
      S get_second() const;
  private:
      F first;
      S second;
  };
  //pair class definitions
  template&lt;typename F, typename S&gt;
  inline Pair&lt;F, S&gt;::Pair(const F&amp; a, const S&amp; b):first(a),second(b){}
  
  template&lt;typename F, typename S&gt;
  inline Pair&lt;F, S&gt;::Pair()
  {
  }
  
  template&lt;typename F, typename S&gt;
  inline F Pair&lt;F, S&gt;::get_first() const
  {
      return first;
  }
  
  template&lt;typename F, typename S&gt;
  inline S Pair&lt;F, S&gt;::get_second() const
  {
      return second;
  }
  //map header
  class map2
  {
  public:
      map2();
      void at_put(string key, int value);
      Pair&lt;string, int&gt; at(string key);
      bool contain_key(string key);
      int value_of(string key);
      void remove_key(string key);
      void print();
  
  private:
      set&lt;Pair&lt;string, int&gt;&gt; theList;
  };
  
  //map definition
  map2::map2(){}
  
  void map2::at_put(string key, int value)
  {
      bool notThere = true;
      if(contain_key(key))
      {
          notThere = false;
      }
      if(notThere)
      {
          Pair&lt;string, int&gt; thePair(key, value);
          theList.insert(thePair);
      }
  }
  
  Pair&lt;string, int&gt; map2::at(string key)
  {
      set&lt;Pair&lt;string, int&gt;&gt;::iterator iter = theList.begin();
      Pair&lt;string, int&gt; thePair;
      string temp;
      for(int x = 0; x&lt;theList.size() ; x++)
      {
          thePair = *iter;
          temp = thePair.get_first();
          if(!key.compare(temp))
          {
              return thePair;
          }
          iter++;
      }
      Pair&lt;string, int&gt; noPair = Pair&lt;string, int&gt;("none", -1);
      return noPair;
  }
  
  bool map2::contain_key(string key)
  {
      set&lt;Pair&lt;string, int&gt;&gt;::iterator iter = theList.begin();
      Pair&lt;string, int&gt; thePair;
      string temp;
      for(int x = 0; x&lt;theList.size() ; x++)
      {
          thePair = *iter;
          temp = thePair.get_first();
          if(!key.compare(temp))
          {
              return true;
          }
          iter++;
      }
      return false;
  }
  
  int map2::value_of(string key)
  {
      set&lt;Pair&lt;string, int&gt;&gt;::iterator iter = theList.begin();
      Pair&lt;string, int&gt; thePair;
      string temp;
      for(int x = 0; x&lt;theList.size() ; x++)
      {
          thePair = *iter;
          temp = thePair.get_first();
          if(!key.compare(temp))
          {
              return thePair.get_second();
          }
          iter++;
      }
      return NULL;
  }
  
  void map2::remove_key(string key)
  {
      set&lt;Pair&lt;string, int&gt;&gt;::iterator iter = theList.begin();
      Pair&lt;string, int&gt; thePair;
      string temp;
      for(int x = 0; x&lt;theList.size() ; x++)
      {
          thePair = *iter;
          temp = thePair.get_first();
          if(!key.compare(temp))
          {
              theList.erase(iter);
          }
          iter++;
      }
  }
  
  void map2::print()
  {
      set&lt;Pair&lt;string, int&gt;&gt;::iterator iter = theList.begin();
      Pair&lt;string, int&gt; thePair;
      string temp;
      int temp2;
      for(int x = 0; x&lt;theList.size() ; x++)
      {
          thePair = *iter;
          temp = thePair.get_first();
          temp2 = thePair.get_second();
          cout &lt;&lt; "Key:" &lt;&lt; temp &lt;&lt; " Value:" &lt;&lt; temp2 &lt;&lt; "\n";
          iter++;
      }
  }
  
  #endif
  </code></pre>
  
  <p>and here is my code that has the main function</p>
  
  <pre><code>#include "map2.h"
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  
  int main()
  {
      map2 theMap;
      theMap.at_put("John", 1000);
      theMap.at_put("Chris", 1000);
      theMap.at_put("John", 1500);
      theMap.at_put("Bob", 1250);
  
      theMap.print();
  
      theMap.remove_key("bob");
  
      theMap.print();
  
      string findKey;
      cout &lt;&lt; "please enter a key to remove" &lt;&lt; "\n";
      cin &gt;&gt; findKey;
  
      bool keyFound = theMap.contain_key(findKey);
  
      if(keyFound)
      {
          cout &lt;&lt; "We found it! The value is:" &lt;&lt; theMap.value_of(findKey) &lt;&lt; "\n";
      }
      else
      {
          cout &lt;&lt; "we don’t have this key " &lt;&lt; findKey &lt;&lt; "in the map" &lt;&lt; "\n";
      }
  
  
  }
  </code></pre>