Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of 'HashTable<Key, Value, Hash, KeyEqual>::Iterator HashTable<Key, Value, Hash, KeyEqual>::find(const Key&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]':
/in/driver/main.cpp:101:34:   required from here
/in/hashtable.hpp:271:94: error: no match for 'operator-' (operand types are 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::iterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' and 'int')
         for(it.listItBefore = buckets[h].before_begin(); it.listItBefore != buckets[h].end() - 1; it++){
In file included from /usr/include/c++/7/vector:65:0,
                 from /usr/include/c++/7/functional:61,
                 from /in/hashtable.hpp:4,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/stl_bvector.h:208:3: note: candidate: std::ptrdiff_t std::operator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
   operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
   ^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:208:3: note:   no known conversion for argument 1 from 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::iterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' to 'const std::_Bit_iterator_base&'
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/stl_iterator.h:1194:5: note: candidate: template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:1194:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:271:94: note:   'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::iterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'const std::move_iterator<_IteratorL>'
         for(it.listItBefore = buckets[h].before_begin(); it.listItBefore != buckets[h].end() - 1; it++){
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/stl_iterator.h:392:5: note: candidate: template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:392:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:271:94: note:   'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::iterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'const std::reverse_iterator<_Iterator>'
         for(it.listItBefore = buckets[h].before_begin(); it.listItBefore != buckets[h].end() - 1; it++){
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of 'bool HashTable<Key, Value, Hash, KeyEqual>::insert(const HashTable<Key, Value, Hash, KeyEqual>::Iterator&, const Key&, const Value&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]':
/in/hashtable.hpp:364:22:   required from 'bool HashTable<Key, Value, Hash, KeyEqual>::insert(const Key&, const Value&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]'
/in/driver/main.cpp:111:43:   required from here
/in/hashtable.hpp:337:13: error: passing 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' as 'this' argument discards qualifiers [-fpermissive]
             it->second = value;
             ^~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:114:19: note:   in call to 'HashTable<Key, Value, Hash, KeyEqual>::HashNode* HashTable<Key, Value, Hash, KeyEqual>::Iterator::operator->() [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; HashTable<Key, Value, Hash, KeyEqual>::HashNode = std::pair<const int, int>]'
         HashNode *operator->() {
                   ^~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of 'HashTable<Key, Value, Hash, KeyEqual>::Iterator HashTable<Key, Value, Hash, KeyEqual>::erase(const HashTable<Key, Value, Hash, KeyEqual>::Iterator&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]':
/in/hashtable.hpp:390:18:   required from 'bool HashTable<Key, Value, Hash, KeyEqual>::erase(const Key&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]'
/in/driver/main.cpp:120:35:   required from here
/in/hashtable.hpp:411:15: error: passing 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' as 'this' argument discards qualifiers [-fpermissive]
             it++;
             ~~^~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:96:18: note:   in call to 'HashTable<Key, Value, Hash, KeyEqual>::Iterator HashTable<Key, Value, Hash, KeyEqual>::Iterator::operator++(int) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]'
         Iterator operator++(int) {
                  ^~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: error: no match for 'operator+' (operand types are 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' and 'int')
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/vector:65:0,
                 from /usr/include/c++/7/functional:61,
                 from /in/hashtable.hpp:4,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/stl_bvector.h:387:3: note: candidate: std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)
   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
   ^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:387:3: note:   no known conversion for argument 1 from 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' to 'std::ptrdiff_t {aka long int}'
/usr/include/c++/7/bits/stl_bvector.h:297:3: note: candidate: std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)
   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
   ^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:297:3: note:   no known conversion for argument 1 from 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' to 'std::ptrdiff_t {aka long int}'
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5995:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, _CharT)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5995:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5989:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _CharT*)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5989:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5983:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(_CharT __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5983:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5977:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const _CharT* __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5977:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   mismatched types 'const _CharT*' and 'std::_Fwd_list_iterator<std::pair<const int, int> >'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5965:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5965:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5959:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5959:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5953:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5953:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5941:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5941:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.h:5925:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5925:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::ListIterator {aka std::_Fwd_list_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.tcc:1173:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.tcc:1173:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:412:53: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
             re.bucketIt->erase_after(re.listItBefore+1);
                                      ~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/basic_string.tcc:1157:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const _CharT* __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.tcc:1157:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0

Information

Submit By
Type
Submission
Homework
Project 2: Hashing
Language
C++
Submit At
2024-11-07 15:18:18
Judged At
2024-11-07 15:18:18
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes