Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 8 years ago

Language

Compiler

Options

Author

anonymous

about 8 years ago

$
prog.cc: In function 'int main()':
prog.cc:16:56: error: no matching function for call to 'std::map<int, int>::insert_or_assign(std::vector<std::pair<int, int> >::iterator, std::vector<std::pair<int, int> >::iterator)'
     persons.insert_or_assign(pairs.begin(), pairs.end());
                                                        ^
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/map:61,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:918:2: note: candidate: 'template<class _Obj> 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_or_assign(const key_type&, _Obj&&) [with _Obj = _Obj; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]'
  insert_or_assign(const key_type& __k, _Obj&& __obj)
  ^~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:918:2: note:   template argument deduction/substitution failed:
prog.cc:16:41: note:   cannot convert 'pairs.std::vector<std::pair<int, int> >::begin()' (type 'std::vector<std::pair<int, int> >::iterator {aka __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >}') to type 'const key_type& {aka const int&}'
     persons.insert_or_assign(pairs.begin(), pairs.end());
                              ~~~~~~~~~~~^~
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/map:61,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:936:2: note: candidate: 'template<class _Obj> 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_or_assign(std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&, _Obj&&) [with _Obj = _Obj; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]'
  insert_or_assign(key_type&& __k, _Obj&& __obj)
  ^~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:936:2: note:   template argument deduction/substitution failed:
prog.cc:16:41: note:   cannot convert 'pairs.std::vector<std::pair<int, int> >::begin()' (type 'std::vector<std::pair<int, int> >::iterator {aka __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >}') to type 'std::map<int, int>::key_type&& {aka int&&}'
     persons.insert_or_assign(pairs.begin(), pairs.end());
                              ~~~~~~~~~~~^~
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/map:61,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:973:2: note: candidate: 'template<class _Obj> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator, const key_type&, _Obj&&) [with _Obj = _Obj; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]'
  insert_or_assign(const_iterator __hint,
  ^~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:973:2: note:   template argument deduction/substitution failed:
prog.cc:16:56: note:   candidate expects 3 arguments, 2 provided
     persons.insert_or_assign(pairs.begin(), pairs.end());
                                                        ^
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/map:61,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:994:2: note: candidate: 'template<class _Obj> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator, std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&, _Obj&&) [with _Obj = _Obj; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]'
  insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
  ^~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_map.h:994:2: note:   template argument deduction/substitution failed:
prog.cc:16:56: note:   candidate expects 3 arguments, 2 provided
     persons.insert_or_assign(pairs.begin(), pairs.end());
                                                        ^
Exit Code:
1