title: GCC-4.7 Compilation error
body: <p>When I add the last line from this snippet to my program code:</p>
  
  <pre><code>typedef std::set&lt;Job&gt; JobSet;
  typedef boost::shared_ptr&lt;JobSet&gt; JobSetPtr;
  JobSetPtr jobs_;
  
  jobs_-&gt;insert ( job );  // line 60
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>    g++-4.7  -o /home/kron/Software/Synchronizer/1.0/Main.o -c src/Main.cpp
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h: In instantiation of ‘bool std::less&lt;_Tp&gt;::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp = Job]’:
  /usr/include/c++/4.7/bits/stl_tree.h:1285:4:   required from ‘std::pair&lt;std::_Rb_tree_iterator&lt;_Val&gt;, bool&gt; std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::_M_insert_unique(const _Val&amp;) [with _Key = Job; _Val = Job; _KeyOfValue = std::_Identity&lt;Job&gt;; _Compare = std::less&lt;Job&gt;; _Alloc = std::allocator&lt;Job&gt;]’
  /usr/include/c++/4.7/bits/stl_set.h:415:29:   required from ‘std::pair&lt;typename std::_Rb_tree&lt;_Key, _Key, std::_Identity&lt;_Key&gt;, _Compare, typename _Alloc::rebind&lt;_Key&gt;::other&gt;::const_iterator, bool&gt; std::set&lt;_Key, _Compare, _Alloc&gt;::insert(const value_type&amp;) [with _Key = Job; _Compare = std::less&lt;Job&gt;; _Alloc = std::allocator&lt;Job&gt;; typename std::_Rb_tree&lt;_Key, _Key, std::_Identity&lt;_Key&gt;, _Compare, typename _Alloc::rebind&lt;_Key&gt;::other&gt;::const_iterator = std::_Rb_tree_const_iterator&lt;Job&gt;; std::set&lt;_Key, _Compare, _Alloc&gt;::value_type = Job]’
  src/Configuration.hpp:60:27:   required from here
  /usr/include/c++/4.7/bits/stl_function.h:236:22: error: no match for ‘operator&lt;’ in ‘__x &lt; __y’
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note: candidates are:
  In file included from /usr/include/c++/4.7/bits/stl_algobase.h:65:0,
                   from /usr/include/c++/4.7/bits/char_traits.h:41,
                   from /usr/include/c++/4.7/ios:41,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_pair.h:218:5: note: template&lt;class _T1, class _T2&gt; bool std::operator&lt;(const std::pair&lt;_T1, _T2&gt;&amp;, const std::pair&lt;_T1, _T2&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_pair.h:218:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::pair&lt;_T1, _T2&gt;’
  In file included from /usr/include/c++/4.7/bits/stl_algobase.h:68:0,
                   from /usr/include/c++/4.7/bits/char_traits.h:41,
                   from /usr/include/c++/4.7/ios:41,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_iterator.h:299:5: note: template&lt;class _Iterator&gt; bool std::operator&lt;(const std::reverse_iterator&lt;_Iterator&gt;&amp;, const std::reverse_iterator&lt;_Iterator&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_iterator.h:299:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::reverse_iterator&lt;_Iterator&gt;’
  In file included from /usr/include/c++/4.7/bits/stl_algobase.h:68:0,
                   from /usr/include/c++/4.7/bits/char_traits.h:41,
                   from /usr/include/c++/4.7/ios:41,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_iterator.h:349:5: note: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator&lt;(const std::reverse_iterator&lt;_IteratorL&gt;&amp;, const std::reverse_iterator&lt;_IteratorR&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_iterator.h:349:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::reverse_iterator&lt;_IteratorL&gt;’
  In file included from /usr/include/c++/4.7/string:54:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/basic_string.h:2566:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator&lt;(const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/basic_string.h:2566:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/string:54:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/basic_string.h:2578:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator&lt;(const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const _CharT*)
  /usr/include/c++/4.7/bits/basic_string.h:2578:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/string:54:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/basic_string.h:2590:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator&lt;(const _CharT*, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/basic_string.h:2590:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   mismatched types ‘const _CharT*’ and ‘Job’
  In file included from /usr/include/c++/4.7/vector:65:0,
                   from src/Main.cpp:2:
  /usr/include/c++/4.7/bits/stl_vector.h:1372:5: note: template&lt;class _Tp, class _Alloc&gt; bool std::operator&lt;(const std::vector&lt;_Tp, _Alloc&gt;&amp;, const std::vector&lt;_Tp, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_vector.h:1372:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::vector&lt;_Tp, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/set:60:0,
                   from src/Configuration.hpp:4,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_tree.h:873:5: note: template&lt;class _Key, class _Val, class _KeyOfValue, class _Compare, class _Alloc&gt; bool std::operator&lt;(const std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;&amp;, const std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_tree.h:873:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/set:61:0,
                   from src/Configuration.hpp:4,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_set.h:721:5: note: template&lt;class _Key, class _Compare, class _Alloc&gt; bool std::operator&lt;(const std::set&lt;_Key, _Compare, _Alloc&gt;&amp;, const std::set&lt;_Key, _Compare, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_set.h:721:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::set&lt;_Key, _Compare, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/set:62:0,
                   from src/Configuration.hpp:4,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_multiset.h:702:5: note: template&lt;class _Key, class _Compare, class _Alloc&gt; bool std::operator&lt;(const std::multiset&lt;_Key, _Compare, _Alloc&gt;&amp;, const std::multiset&lt;_Key, _Compare, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_multiset.h:702:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::multiset&lt;_Key, _Compare, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/list:64:0,
                   from /usr/include/boost/algorithm/string/std/list_traits.hpp:15,
                   from /usr/include/boost/algorithm/string/std_containers_traits.hpp:20,
                   from /usr/include/boost/algorithm/string.hpp:18,
                   from src/Configuration.hpp:9,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_list.h:1659:5: note: template&lt;class _Tp, class _Alloc&gt; bool std::operator&lt;(const std::list&lt;_Tp, _Alloc&gt;&amp;, const std::list&lt;_Tp, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_list.h:1659:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::list&lt;_Tp, _Alloc&gt;’
  In file included from /usr/include/c++/4.7/deque:65:0,
                   from /usr/include/boost/algorithm/string/find_format.hpp:14,
                   from /usr/include/boost/algorithm/string/replace.hpp:22,
                   from /usr/include/boost/algorithm/string.hpp:25,
                   from src/Configuration.hpp:9,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_deque.h:274:5: note: template&lt;class _Tp, class _Ref, class _Ptr&gt; bool std::operator&lt;(const std::_Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp;, const std::_Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_deque.h:274:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::_Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;’
  In file included from /usr/include/c++/4.7/deque:65:0,
                   from /usr/include/boost/algorithm/string/find_format.hpp:14,
                   from /usr/include/boost/algorithm/string/replace.hpp:22,
                   from /usr/include/boost/algorithm/string.hpp:25,
                   from src/Configuration.hpp:9,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_deque.h:282:5: note: template&lt;class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR&gt; bool std::operator&lt;(const std::_Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp;, const std::_Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_deque.h:282:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::_Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;’
  In file included from /usr/include/c++/4.7/deque:65:0,
                   from /usr/include/boost/algorithm/string/find_format.hpp:14,
                   from /usr/include/boost/algorithm/string/replace.hpp:22,
                   from /usr/include/boost/algorithm/string.hpp:25,
                   from src/Configuration.hpp:9,
                   from src/Main.cpp:5:
  /usr/include/c++/4.7/bits/stl_deque.h:1947:5: note: template&lt;class _Tp, class _Alloc&gt; bool std::operator&lt;(const std::deque&lt;_Tp, _Alloc&gt;&amp;, const std::deque&lt;_Tp, _Alloc&gt;&amp;)
  /usr/include/c++/4.7/bits/stl_deque.h:1947:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/4.7/string:50:0,
                   from /usr/include/c++/4.7/bits/locale_classes.h:42,
                   from /usr/include/c++/4.7/bits/ios_base.h:43,
                   from /usr/include/c++/4.7/ios:43,
                   from /usr/include/c++/4.7/ostream:40,
                   from /usr/include/c++/4.7/iostream:40,
                   from src/Main.cpp:1:
  /usr/include/c++/4.7/bits/stl_function.h:236:22: note:   ‘const Job’ is not derived from ‘const std::deque&lt;_Tp, _Alloc&gt;’
  make: *** [/home/kron/Software/Synchronizer/1.0/Main.o] Error 1
  </code></pre>
  
  <p>Is it my fault? If yes, what I did wrong? If no, does somebody have the same error?</p>