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:5: error: no return statement in function returning non-void [-Werror=return-type]
     }
     ^
/in/hashtable.hpp: In copy constructor 'HashTable<Key, Value, Hash, KeyEqual>::HashTable(const HashTable<Key, Value, Hash, KeyEqual>&)':
/in/hashtable.hpp:205:17: error: returning a value from a constructor
         return *this;
                 ^~~~
/in/hashtable.hpp: In member function 'HashTable<Key, Value, Hash, KeyEqual>::Iterator HashTable<Key, Value, Hash, KeyEqual>::find(const Key&)':
/in/hashtable.hpp:255:33: error: 'listItBefore' was not declared in this scope
         auto  newlistItBefore = listItBefore;
                                 ^~~~~~~~~~~~
/in/hashtable.hpp:255:33: note: suggested alternative: 'newlistItBefore'
         auto  newlistItBefore = listItBefore;
                                 ^~~~~~~~~~~~
                                 newlistItBefore
/in/hashtable.hpp: In member function 'bool HashTable<Key, Value, Hash, KeyEqual>::erase(const Key&)':
/in/hashtable.hpp:354:9: error: expected ';' before '}' token
         } 
         ^
/in/hashtable.hpp: In instantiation of '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:317:28: error: invalid conversion from 'HashTable<int, int, std::hash<int>, std::equal_to<int> >*' to 'int' [-fpermissive]
         Iterator it =  find(this);
                        ~~~~^~~~~~
/in/hashtable.hpp:247:14: note:   initializing argument 1 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>]'
     Iterator find(const Key &key) {
              ^~~~
/in/hashtable.hpp:324:41: error: conversion to 'double' from 'size_t {aka long unsigned int}' may alter its value [-Werror=conversion]
                 rehash(static_cast<int>(tableSize/maxLoadFactor)+1);
                                         ^~~~~~~~~
/in/hashtable.hpp: In instantiation of 'Value& HashTable<Key, Value, Hash, KeyEqual>::operator[](const Key&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]':
/in/driver/main.cpp:129:94:   required from here
/in/hashtable.hpp:392:37: error: request for member 'Value' 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 '->' ?)
             insert(it_hash,key,this.Value());
                                ~~~~~^~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 2: Hashing
Language
C++
Submit At
2023-12-21 23:33:58
Judged At
2023-12-21 23:33:58
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes