title: std::set.insert won't compile with custom class
body: <p>I have a class, Record, with three private integer fields, getters and setters, and a default and specific constructor. I intend to populate a set with Records, but am having issues getting the code to work.</p>
  
  <pre><code>#include &lt;set&gt;
  using namespace std;
  
  class Record
  {
      int a, b, c;
      public:
      //getters and setters
      Record(){a = -1; b = -1; c = -1;};
  }
  
  int main()
  {
      set&lt; Record &gt; s;
      s.insert(Record());
  }
  </code></pre>
  
  <p>Attempting to compile results in this error:</p>
  
  <blockquote>
    <p>C:\Users\Denton\Documents\Indiana University\Class Documents\Spring
    2013\CSCI-H2
        12\Assignment9>g++ a9.cpp -o a9
        In file included from c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/string:5
        0:0,
                         from c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/loc
        ale_classes.h:42,
                         from c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/ios
        _base.h:43,
                         from c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/ios:43,
                         from c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/ostream:
        40,
                         from c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/iostream
        :40,
                         from a9.cpp:3:
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_function.h:
    In member
         function 'bool std::less&lt;_Tp>::operator()(const _Tp&amp;, const _Tp&amp;) const [with _
        Tp = Record]':
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_tree.h:1267:4:
    inst
        antiated from 'std::pair, bool> std::_Rb_tree&lt;_Key,
         _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(const _Val&amp;) [with _Key
        = Record, _Val = Record, _KeyOfValue = std::_Identity, _Compare = std::l
        ess, _Alloc = std::allocator]'
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_set.h:410:29:
    insta
        ntiated from 'std::pair,
         _Compare, typename _Alloc::rebind&lt;_Key>::other>::const_iterator, bool> std::set
        &lt;_Key, _Compare, _Alloc>::insert(const value_type&amp;) [with _Key = Record, _Compar
        e = std::less, _Alloc = std::allocator, typename std::_Rb_tree&lt;_
        Key, _Key, std::_Identity&lt;_Key>, _Compare, typename _Alloc::rebind&lt;_Key>::other>
        ::const_iterator = std::_Rb_tree_const_iterator, std::set&lt;_Key, _Compare
        , _Alloc>::value_type = Record]'
        a9.cpp:72:28:   instantiated from here
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_function.h:236:22:
    er
        ror: no match for 'operator&lt;' in '__x &lt; __y'
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_function.h:236:22:
    no
        te: candidates are:
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_pair.h:207:5:
    note: t
        emplate bool std::operator&lt;(const std::pair&lt;_T1, _T2>&amp;, co
        nst std::pair&lt;_T1, _T2>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_iterator.h:291:5:
    not
        e: template bool std::operator&lt;(const std::reverse_iterator&lt;_It
        erator>&amp;, const std::reverse_iterator&lt;_Iterator>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_iterator.h:341:5:
    not
        e: template bool std::operator&lt;(const std::r
        everse_iterator&lt;_IteratorL>&amp;, const std::reverse_iterator&lt;_IteratorR>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/basic_string.h:2510:5:
    no
        te: template bool std::operator&lt;(cons
        t std::basic_string&lt;_CharT, _Traits, _Alloc>&amp;, const std::basic_string&lt;_CharT, _
        Traits, _Alloc>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/basic_string.h:2522:5:
    no
        te: template bool std::operator&lt;(cons
        t std::basic_string&lt;_CharT, _Traits, _Alloc>&amp;, const _CharT*)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/basic_string.h:2534:5:
    no
        te: template bool std::operator&lt;(cons
        t _CharT*, const std::basic_string&lt;_CharT, _Traits, _Alloc>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_vector.h:1290:5:
    note
        : template bool std::operator&lt;(const std::vector&lt;_Tp, _
        Alloc>&amp;, const std::vector&lt;_Tp, _Alloc>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_list.h:1593:5:
    note:
        template bool std::operator&lt;(const std::list&lt;_Tp, _Allo
        c>&amp;, const std::list&lt;_Tp, _Alloc>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_tree.h:856:5:
    note: t
        emplate
         bool std::operator&lt;(const std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _All
        oc>&amp;, const std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_set.h:713:5:
    note: te
        mplate bool std::operator&lt;(const std::
        set&lt;_Key, _Compare, _Alloc>&amp;, const std::set&lt;_Key, _Compare, _Alloc>&amp;)
        c:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_multiset.h:696:5:
    not
        e: template bool std::operator&lt;(const
        std::multiset&lt;_Key, _Compare, _Alloc>&amp;, const std::multiset&lt;_Key, _Compare, _All
        oc>&amp;)</p>
  </blockquote>
  
  <p>insert works fine when I make a set s and s.insert(1)
  What needs to be done for this code to compile?</p>
  
  <p>Thanks in advance.</p>