Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In member function 'size_t HashTable<Key, Value, Hash, KeyEqual>::findMinimumBucketSize(size_t) const':
/in/hashtable.hpp:172:50: error: 'Hashprime' has not been declared
         size_t minBucketSize = *std::lower_bound(Hashprime::g_a_sizes, Hashprime::g_a_sizes + num_distinct_sizes, bucketSize);
                                                  ^~~~~~~~~
/in/hashtable.hpp:172:72: error: 'Hashprime' has not been declared
         size_t minBucketSize = *std::lower_bound(Hashprime::g_a_sizes, Hashprime::g_a_sizes + num_distinct_sizes, bucketSize);
                                                                        ^~~~~~~~~
/in/hashtable.hpp:172:95: error: 'num_distinct_sizes' was not declared in this scope
         size_t minBucketSize = *std::lower_bound(Hashprime::g_a_sizes, Hashprime::g_a_sizes + num_distinct_sizes, bucketSize);
                                                                                               ^~~~~~~~~~~~~~~~~~
/in/hashtable.hpp:172:95: note: suggested alternative:
In file included from /in/hashtable.hpp:1:0,
                 from /in/driver/main.cpp:5:
/in/driver/hash_prime.hpp:9:9: note:   'num_distinct_sizes'
         num_distinct_sizes = sizeof(std::size_t) != 8 ?
         ^~~~~~~~~~~~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:175:47: error: 'Hashprime' has not been declared
             minBucketSize = *std::lower_bound(Hashprime::g_a_sizes, Hashprime::g_a_sizes + num_distinct_sizes, minBucketSize);
                                               ^~~~~~~~~
/in/hashtable.hpp:175:69: error: 'Hashprime' has not been declared
             minBucketSize = *std::lower_bound(Hashprime::g_a_sizes, Hashprime::g_a_sizes + num_distinct_sizes, minBucketSize);
                                                                     ^~~~~~~~~
/in/hashtable.hpp: In member function 'HashTable<Key, Value, Hash, KeyEqual>::Iterator HashTable<Key, Value, Hash, KeyEqual>::find(const Key&)':
/in/hashtable.hpp:247:40: error: expected ';' before ')' token
         for(it, it!=buckets.end(), ++it){
                                        ^
/in/hashtable.hpp:254:26: error: expected ')' before ';' token
         it.endFlag = true;
                          ^
/in/hashtable.hpp: In member function 'bool HashTable<Key, Value, Hash, KeyEqual>::insert(const HashTable<Key, Value, Hash, KeyEqual>::Iterator&, const Key&, const Value&)':
/in/hashtable.hpp:272:44: error: 'second' was not declared in this scope
         if(it.first == key && it.second == second) return false;
                                            ^~~~~~
/in/hashtable.hpp:272:44: note: suggested alternative: 'end'
         if(it.first == key && it.second == second) return false;
                                            ^~~~~~
                                            end
/in/hashtable.hpp: In member function 'bool HashTable<Key, Value, Hash, KeyEqual>::erase(const Key&)':
/in/hashtable.hpp:309:37: error: expected ';' before ')' token
         for(i, i!=buckets.end(), i++){ //find iterator right before where we want to erase
                                     ^
/in/hashtable.hpp:314:9: error: expected primary-expression before 'return'
         return true;
         ^~~~~~
/in/hashtable.hpp:314:9: error: expected ')' before 'return'
/in/hashtable.hpp: In member function 'HashTable<Key, Value, Hash, KeyEqual>::Iterator HashTable<Key, Value, Hash, KeyEqual>::erase(const HashTable<Key, Value, Hash, KeyEqual>::Iterator&)':
/in/hashtable.hpp:329:37: error: expected ';' before ')' token
         for(i, i!=buckets.end(), i++){ //find iterator right before where we want to erase
                                     ^
/in/hashtable.hpp:334:9: error: expected primary-expression before 'return'
         return ++temp;
         ^~~~~~
/in/hashtable.hpp:334:9: error: expected ')' before 'return'
/in/hashtable.hpp:334:18: error: 'temp' was not declared in this scope
         return ++temp;
                  ^~~~
/in/hashtable.hpp:334:18: note: suggested alternative: 'mktemp'
         return ++temp;
                  ^~~~
                  mktemp
/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:247:15: error: left operand of comma operator has no effect [-Werror=unused-value]
         for(it, it!=buckets.end(), ++it){
/in/hashtable.hpp:247:9: error: could not convert 'it' from 'std::_Fwd_list_iterator<std::pair<const int, int> >' to 'bool'
         for(it, it!=buckets.end(), ++it){
         ^~~
/in/hashtable.hpp:254:12: error: 'struct std::_Fwd_list_iterator<std::pair<const int, int> >' has no member named 'endFlag'
         it.endFlag = true;
         ~~~^~~~~~~
/in/hashtable.hpp:255:16: error: could not convert 'it' from '__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 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator'
         return it;
                ^~
/in/hashtable.hpp: In instantiation of '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:309:14: error: left operand of comma operator has no effect [-Werror=unused-value]
         for(i, i!=buckets.end(), i++){ //find iterator right before where we want to erase
/in/hashtable.hpp:309:9: error: no matching function for call to 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::erase_after(__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> > > > > >&)'
         for(i, i!=buckets.end(), i++){ //find iterator right before where we want to erase
         ^~~
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.h:966:7: note: candidate: std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::erase_after(std::forward_list<_Tp, _Alloc>::const_iterator) [with _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::iterator = std::_Fwd_list_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::const_iterator = std::_Fwd_list_const_iterator<std::pair<const int, int> >]
       erase_after(const_iterator __pos)
       ^~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.h:966:7: note:   no known conversion for argument 1 from '__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 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::const_iterator {aka std::_Fwd_list_const_iterator<std::pair<const int, int> >}'
/usr/include/c++/7/bits/forward_list.h:989:7: note: candidate: std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::erase_after(std::forward_list<_Tp, _Alloc>::const_iterator, std::forward_list<_Tp, _Alloc>::const_iterator) [with _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::iterator = std::_Fwd_list_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::const_iterator = std::_Fwd_list_const_iterator<std::pair<const int, int> >]
       erase_after(const_iterator __pos, const_iterator __last)
       ^~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.h:989:7: note:   candidate expects 2 arguments, 1 provided
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:293: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:272:15: error: 'const class HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' has no member named 'first'
         if(it.first == key && it.second == second) return false;
            ~~~^~~~~
/in/hashtable.hpp:272:34: error: 'const class HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' has no member named 'second'
         if(it.first == key && it.second == second) return false;
                               ~~~^~~~~~
/in/hashtable.hpp:274:14: error: request for member 'tableSize' in '(HashTable<int, int, std::hash<int>, std::equal_to<int> >*)this', which is of pointer type 'HashTable<int, int, std::hash<int>, std::equal_to<int> >*' (maybe you meant to use '->' ?)
         this.tableSize++; //increment table size
         ~~~~~^~~~~~~~~
/in/hashtable.hpp:275:15: error: invalid use of non-static member function 'size_t HashTable<Key, Value, Hash, KeyEqual>::bucketSize() const [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; size_t = long unsigned int]'
         rehash(bucketSize);
         ~~~~~~^~~~~~~~~~~~
/in/hashtable.hpp:374:12: note: declared here
     size_t bucketSize() const { return buckets.size(); }
            ^~~~~~~~~~
/in/hashtable.hpp:276:45: error: left operand of comma operator has no effect [-Werror=unused-value]
         firstBucketIt->insert_after(it,((key,value)));
                                        ~~~~~^~~~~~~~
/in/hashtable.hpp:276:9: error: no matching function for call to 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::insert_after(const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator&, const int&)'
         firstBucketIt->insert_after(it,((key,value)));
         ^~~~~~~~~~~~~
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.h:880:7: note: candidate: std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::insert_after(std::forward_list<_Tp, _Alloc>::const_iterator, const _Tp&) [with _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::iterator = std::_Fwd_list_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::const_iterator = std::_Fwd_list_const_iterator<std::pair<const int, int> >]
       insert_after(const_iterator __pos, const _Tp& __val)
       ^~~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.h:880:7: note:   no known conversion for argument 1 from 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' to 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::const_iterator {aka std::_Fwd_list_const_iterator<std::pair<const int, int> >}'
/usr/include/c++/7/bits/forward_list.h:887:7: note: candidate: std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::insert_after(std::forward_list<_Tp, _Alloc>::const_iterator, _Tp&&) [with _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::iterator = std::_Fwd_list_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::const_iterator = std::_Fwd_list_const_iterator<std::pair<const int, int> >]
       insert_after(const_iterator __pos, _Tp&& __val)
       ^~~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.h:887:7: note:   no known conversion for argument 1 from 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' to 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::const_iterator {aka std::_Fwd_list_const_iterator<std::pair<const int, int> >}'
In file included from /usr/include/c++/7/forward_list:40:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.tcc:259:5: note: candidate: std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::insert_after(std::forward_list<_Tp, _Alloc>::const_iterator, std::forward_list<_Tp, _Alloc>::size_type, const _Tp&) [with _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::iterator = std::_Fwd_list_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::const_iterator = std::_Fwd_list_const_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::size_type = long unsigned int]
     forward_list<_Tp, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.tcc:259:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.h:926:9: note: candidate: template<class _InputIterator, class> std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::insert_after(std::forward_list<_Tp, _Alloc>::const_iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >]
         insert_after(const_iterator __pos,
         ^~~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.h:926:9: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:276:9: note:   candidate expects 3 arguments, 2 provided
         firstBucketIt->insert_after(it,((key,value)));
         ^~~~~~~~~~~~~
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /in/hashtable.hpp:6,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/forward_list.h:945:7: note: candidate: std::forward_list<_Tp, _Alloc>::iterator std::forward_list<_Tp, _Alloc>::insert_after(std::forward_list<_Tp, _Alloc>::const_iterator, std::initializer_list<_Tp>) [with _Tp = std::pair<const int, int>; _Alloc = std::allocator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::iterator = std::_Fwd_list_iterator<std::pair<const int, int> >; std::forward_list<_Tp, _Alloc>::const_iterator = std::_Fwd_list_const_iterator<std::pair<const int, int> >]
       insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
       ^~~~~~~~~~~~
/usr/include/c++/7/bits/forward_list.h:945:7: note:   no known conversion for argument 1 from 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator' to 'std::forward_list<std::pair<const int, int>, std::allocator<std::pair<const int, int> > >::const_iterator {aka std::_Fwd_list_const_iterator<std::pair<const int, int> >}'
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In member function 'Value& HashTable<Key, Value, Hash, KeyEqual>::operator[](const Key&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]':
/in/hashtable.hpp:349:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 2: Hashing
Language
C++
Submit At
2022-11-10 23:40:12
Judged At
2022-12-08 14:48:24
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes