Borderou de evaluare (job #1034970)

Utilizator matei_cChristescu Matei matei_c Data 18 noiembrie 2013 11:16:57
Problema Pariuri Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘int main()’: user.cpp:41:32: error: no matching function for call to ‘std::unordered_map<int, int>::insert(int&)’ tt.insert( mom ) ; ^ user.cpp:41:32: note: candidates are: In file included from /usr/local/include/c++/4.8.0/unordered_map:48:0, from user.cpp:4: /usr/local/include/c++/4.8.0/bits/unordered_map.h:362:7: note: std::pair<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator, bool> std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(const value_type&) [with _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator = std::__detail::_Node_iterator<std::pair<const int, int>, false, false>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::value_type = std::pair<const int, int>] insert(const value_type& __x) ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:362:7: note: no known conversion for argument 1 from ‘int’ to ‘const value_type& {aka const std::pair<const int, int>&}’ /usr/local/include/c++/4.8.0/bits/unordered_map.h:369:2: note: template<class _Pair, class> std::pair<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator, bool> std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_Pair&&) [with _Pair = _Pair; <template-parameter-2-2> = <template-parameter-1-2>; _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >] insert(_Pair&& __x) ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:369:2: note: template argument deduction/substitution failed: /usr/local/include/c++/4.8.0/bits/unordered_map.h:365:32: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’ template<typename _Pair, typename = typename ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:396:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator, const value_type&) [with _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator = std::__detail::_Node_iterator<std::pair<const int, int>, false, false>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator = std::__detail::_Node_const_iterator<std::pair<const int, int>, false, false>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::value_type = std::pair<const int, int>] insert(const_iterator __hint, const value_type& __x) ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:396:7: note: candidate expects 2 arguments, 1 provided /usr/local/include/c++/4.8.0/bits/unordered_map.h:403:2: note: template<class _Pair, class> std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator, _Pair&&) [with _Pair = _Pair; <template-parameter-2-2> = <template-parameter-1-2>; _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >] insert(const_iterator __hint, _Pair&& __x) ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:403:2: note: template argument deduction/substitution failed: user.cpp:41:32: note: cannot convert ‘mom’ (type ‘int’) to type ‘std::unordered_map<int, int>::const_iterator {aka std::__detail::_Node_const_iterator<std::pair<const int, int>, false, false>}’ tt.insert( mom ) ; ^ In file included from /usr/local/include/c++/4.8.0/unordered_map:48:0, from user.cpp:4: /usr/local/include/c++/4.8.0/bits/unordered_map.h:418:2: note: template<class _InputIterator> void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >] insert(_InputIterator __first, _InputIterator __last) ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:418:2: note: template argument deduction/substitution failed: user.cpp:41:32: note: candidate expects 2 arguments, 1 provided tt.insert( mom ) ; ^ In file included from /usr/local/include/c++/4.8.0/unordered_map:48:0, from user.cpp:4: /usr/local/include/c++/4.8.0/bits/unordered_map.h:429:7: note: void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type>) [with _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type = std::pair<const int, int>] insert(initializer_list<value_type> __l) ^ /usr/local/include/c++/4.8.0/bits/unordered_map.h:429:7: note: no known conversion for argument 1 from ‘int’ to ‘std::initializer_list<std::pair<const int, int> >’ user.cpp:51:42: error: conversion from ‘std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}’ to non-scalar type ‘std::set<int>::iterator {aka std::_Rb_tree_const_iterator<int>}’ requested for(set<int>::iterator it = tt.begin(); it != tt.end(); ++it ) ^ user.cpp:51:48: error: no match for ‘operator!=’ (operand types are ‘std::set<int>::iterator {aka std::_Rb_tree_const_iterator<int>}’ and ‘std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}’) for(set<int>::iterator it = tt.begin(); it != tt.end(); ++it ) ^

Ceva nu functioneaza?