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:256:27: error: conversion to 'int' from 'std::size_t {aka long unsigned int}' may alter its value [-Werror=conversion]
         int i = hash(key) | (int)bucketSize();
/in/hashtable.hpp:257:18: error: conversion from 'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}' to non-scalar type 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' requested
         Iterator it = buckets.begin();
                  ^~
/in/hashtable.hpp:259:16: error: no match for 'operator=' (operand types are 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' and 'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}')
             it = buckets.end();
/in/hashtable.hpp:91:19: note: candidate: constexpr HashTable<Key, Value, Hash, KeyEqual>::Iterator& HashTable<Key, Value, Hash, KeyEqual>::Iterator::operator=(const HashTable<Key, Value, Hash, KeyEqual>::Iterator&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]
         Iterator &operator=(const Iterator &) = default;
                   ^~~~~~~~
/in/hashtable.hpp:91:19: note:   no known conversion for argument 1 from 'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}' to 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator&'
/in/hashtable.hpp:263:19: error: no match for 'operator!=' (operand types are 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' and 'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}')
         while (it != buckets.end()) {
/in/hashtable.hpp:110:14: note: candidate: bool HashTable<Key, Value, Hash, KeyEqual>::Iterator::operator!=(const HashTable<Key, Value, Hash, KeyEqual>::Iterator&) const [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]
         bool operator!=(const Iterator &that) const {
              ^~~~~~~~
/in/hashtable.hpp:110:14: note:   no known conversion for argument 1 from 'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}' to 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator&'
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 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/ext/new_allocator.h:160:5: note: candidate: template<class _Tp> bool __gnu_cxx::operator!=(const __gnu_cxx::new_allocator<_Tp>&, const __gnu_cxx::new_allocator<_Tp>&)
     operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
     ^~~~~~~~
/usr/include/c++/7/ext/new_allocator.h:160:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const __gnu_cxx::new_allocator<_Tp>'
         while (it != buckets.end()) {
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:883:5: note: candidate: template<class _Iterator, class _Container> bool __gnu_cxx::operator!=(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)
     operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:883:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>'
         while (it != buckets.end()) {
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:876:5: note: candidate: template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator!=(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)
     operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:876:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/functional:61,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/stl_vector.h:1625:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator!=(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:1625:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::vector<_Tp, _Alloc>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/unordered_map:48:0,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/unordered_map.h:1922:5: note: candidate: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> bool std::operator!=(const std::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&, const std::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&)
     operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/unordered_map.h:1922:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/unordered_map:48:0,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/unordered_map.h:1910:5: note: candidate: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> bool std::operator!=(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&, const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&)
     operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/unordered_map.h:1910:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/bits/node_handle.h:39:0,
                 from /usr/include/c++/7/bits/hashtable.h:37,
                 from /usr/include/c++/7/unordered_map:47,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/optional:922:5: note: candidate: template<class _Tp, class _Up> constexpr std::__optional_relop_t<decltype ((declval<_Up>() != declval<_Tp>()))> std::operator!=(const _Up&, const std::optional<_Tp>&)
     operator!=(const _Up& __lhs, const optional<_Tp>& __rhs)
     ^~~~~~~~
/usr/include/c++/7/optional:922:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}' is not derived from 'const std::optional<_Tp>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/bits/node_handle.h:39:0,
                 from /usr/include/c++/7/bits/hashtable.h:37,
                 from /usr/include/c++/7/unordered_map:47,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/optional:916:5: note: candidate: template<class _Tp, class _Up> constexpr std::__optional_relop_t<decltype ((declval<_Tp>() != declval<_Up>()))> std::operator!=(const std::optional<_Tp>&, const _Up&)
     operator!=(const optional<_Tp>& __lhs, const _Up& __rhs)
     ^~~~~~~~
/usr/include/c++/7/optional:916:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::optional<_Tp>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/bits/node_handle.h:39:0,
                 from /usr/include/c++/7/bits/hashtable.h:37,
                 from /usr/include/c++/7/unordered_map:47,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/optional:858:5: note: candidate: template<class _Tp> constexpr bool std::operator!=(std::nullopt_t, const std::optional<_Tp>&)
     operator!=(nullopt_t, const optional<_Tp>& __rhs) noexcept
     ^~~~~~~~
/usr/include/c++/7/optional:858:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}' is not derived from 'const std::optional<_Tp>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/bits/node_handle.h:39:0,
                 from /usr/include/c++/7/bits/hashtable.h:37,
                 from /usr/include/c++/7/unordered_map:47,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/optional:853:5: note: candidate: template<class _Tp> constexpr bool std::operator!=(const std::optional<_Tp>&, std::nullopt_t)
     operator!=(const optional<_Tp>& __lhs, nullopt_t) noexcept
     ^~~~~~~~
/usr/include/c++/7/optional:853:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::optional<_Tp>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/bits/node_handle.h:39:0,
                 from /usr/include/c++/7/bits/hashtable.h:37,
                 from /usr/include/c++/7/unordered_map:47,
                 from /usr/include/c++/7/functional:60,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/optional:801:5: note: candidate: template<class _Tp, class _Up> constexpr std::__optional_relop_t<decltype ((declval<_Tp>() != declval<_Up>()))> std::operator!=(const std::optional<_Tp>&, const std::optional<_Up>&)
     operator!=(const optional<_Tp>& __lhs, const optional<_Up>& __rhs)
     ^~~~~~~~
/usr/include/c++/7/optional:801:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::optional<_Tp>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/functional:58:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/std_function.h:788:5: note: candidate: template<class _Res, class ... _Args> bool std::operator!=(std::nullptr_t, const std::function<_Res(_ArgTypes ...)>&)
     operator!=(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
     ^~~~~~~~
/usr/include/c++/7/bits/std_function.h:788:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > >::iterator {aka __gnu_cxx::__normal_iterator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >*, std::vector<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >, std::allocator<std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > > > > >}' is not derived from 'const std::function<_Res(_ArgTypes ...)>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/functional:58:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/std_function.h:782:5: note: candidate: template<class _Res, class ... _Args> bool std::operator!=(const std::function<_Res(_ArgTypes ...)>&, std::nullptr_t)
     operator!=(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
     ^~~~~~~~
/usr/include/c++/7/bits/std_function.h:782:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::function<_Res(_ArgTypes ...)>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /in/hashtable.hpp:5,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.h:1396:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator!=(const std::forward_list<_Tp, _Alloc>&, const std::forward_list<_Tp, _Alloc>&)
     operator!=(const forward_list<_Tp, _Alloc>& __lx,
     ^~~~~~~~
/usr/include/c++/7/bits/forward_list.h:1396:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::forward_list<_Tp, _Alloc>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /in/hashtable.hpp:5,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.h:266:5: note: candidate: template<class _Tp> bool std::operator!=(const std::_Fwd_list_iterator<_Tp>&, const std::_Fwd_list_const_iterator<_Tp>&)
     operator!=(const _Fwd_list_iterator<_Tp>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/forward_list.h:266:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:263:19: note:   'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' is not derived from 'const std::_Fwd_list_iterator<_Tp>'
         while (it != buckets.end()) {
In file included from /usr/include/c++/7/bits/locale_conv.h:41:0,
                 from /usr/include/c++/7/locale:43,
                 from /usr/include/c++/7/iomanip:43,
                 from /in/driver/main.cpp:2:
/usr/include/c++/7/bits/unique_ptr.h:707:5: note: candidate: template<class _Tp, class _Dp> bool std::operator!=(std::null

Information

Submit By
Type
Submission
Homework
Project 2: Hashing
Language
C++
Submit At
2024-07-05 23:28:49
Judged At
2024-07-05 23:28:49
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes