fork download
  1. #include <string>
  2. #include <map>
  3.  
  4. struct Order
  5. {
  6. std::string A;
  7. std::string B;
  8. };
  9.  
  10. int main()
  11. {
  12. std::map<Order, int> mmap;
  13. mmap.insert(std::make_pair(Order(), 1));
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h: In instantiation of 'constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Order]':
/usr/include/c++/5/bits/stl_tree.h:1810:11:   required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = Order; _Val = std::pair<const Order, int>; _KeyOfValue = std::_Select1st<std::pair<const Order, int> >; _Compare = std::less<Order>; _Alloc = std::allocator<std::pair<const Order, int> >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_type = Order]'
/usr/include/c++/5/bits/stl_tree.h:1863:28:   required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = std::pair<Order, int>; _Key = Order; _Val = std::pair<const Order, int>; _KeyOfValue = std::_Select1st<std::pair<const Order, int> >; _Compare = std::less<Order>; _Alloc = std::allocator<std::pair<const Order, int> >]'
/usr/include/c++/5/bits/stl_map.h:621:64:   required from 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(_Pair&&) [with _Pair = std::pair<Order, int>; <template-parameter-2-2> = void; _Key = Order; _Tp = int; _Compare = std::less<Order>; _Alloc = std::allocator<std::pair<const Order, int> >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree_iterator<std::pair<const Order, int> >]'
prog.cpp:13:44:   required from here
/usr/include/c++/5/bits/stl_function.h:387:20: error: no match for 'operator<' (operand types are 'const Order' and 'const Order')
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:220:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/5/bits/stl_pair.h:220:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::pair<_T1, _T2>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:298:5: note: candidate: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:298:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::reverse_iterator<_Iterator>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:348:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:348:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::reverse_iterator<_Iterator>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:1089:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&)
     operator<(const move_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:1089:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::move_iterator<_Iterator>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:1095:5: note: candidate: template<class _Iterator> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&)
     operator<(const move_iterator<_Iterator>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:1095:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::move_iterator<_Iterator>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/string:52:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/basic_string.h:4985:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4985:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/string:52:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/basic_string.h:4997:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4997:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/string:52:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/basic_string.h:5009:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const _CharT* __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:5009:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   mismatched types 'const _CharT*' and 'Order'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/map:60:0,
                 from prog.cpp:2:
/usr/include/c++/5/bits/stl_tree.h:1283:5: note: candidate: template<class _Key, class _Val, class _KeyOfValue, class _Compare, class _Alloc> bool std::operator<(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)
     operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/stl_tree.h:1283:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/tuple:39:0,
                 from /usr/include/c++/5/bits/stl_map.h:63,
                 from /usr/include/c++/5/map:61,
                 from prog.cpp:2:
/usr/include/c++/5/array:250:5: note: candidate: template<class _Tp, unsigned int _Nm> bool std::operator<(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
     ^
/usr/include/c++/5/array:250:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::array<_Tp, _Nm>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/bits/stl_map.h:63:0,
                 from /usr/include/c++/5/map:61,
                 from prog.cpp:2:
/usr/include/c++/5/tuple:928:5: note: candidate: template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const std::tuple<_Args1 ...>&, const std::tuple<_Args2 ...>&)
     operator<(const tuple<_TElements...>& __t,
     ^
/usr/include/c++/5/tuple:928:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::tuple<_Args1 ...>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/map:61:0,
                 from prog.cpp:2:
/usr/include/c++/5/bits/stl_map.h:1090:5: note: candidate: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const std::map<_Key, _Tp, _Compare, _Alloc>&, const std::map<_Key, _Tp, _Compare, _Alloc>&)
     operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/stl_map.h:1090:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::map<_Key, _Tp, _Compare, _Alloc>'
       { return __x < __y; }
                    ^
In file included from /usr/include/c++/5/map:62:0,
                 from prog.cpp:2:
/usr/include/c++/5/bits/stl_multimap.h:991:5: note: candidate: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const std::multimap<_Key, _Tp, _Compare, _Alloc>&, const std::multimap<_Key, _Tp, _Compare, _Alloc>&)
     operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/stl_multimap.h:991:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/5/string:48:0,
                 from prog.cpp:1:
/usr/include/c++/5/bits/stl_function.h:387:20: note:   'const Order' is not derived from 'const std::multimap<_Key, _Tp, _Compare, _Alloc>'
       { return __x < __y; }
                    ^
stdout
Standard output is empty