Record Detail

Compile Error

/in/driver/main.cpp:37:9: error: declaration of template parameter 'Key' shadows template parameter
         typename Key, typename Value,
         ^~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:21:9: note: template parameter 'Key' declared here
         typename Key, typename Value,
         ^~~~~~~~
/in/driver/main.cpp:37:23: error: declaration of template parameter 'Value' shadows template parameter
         typename Key, typename Value,
                       ^~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:21:23: note: template parameter 'Value' declared here
         typename Key, typename Value,
                       ^~~~~~~~
/in/driver/main.cpp:38:9: error: declaration of template parameter 'Hash' shadows template parameter
         typename Hash = std::hash<Key>,
         ^~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:22:9: note: template parameter 'Hash' declared here
         typename Hash = std::hash<Key>,
         ^~~~~~~~
/in/driver/main.cpp:39:9: error: declaration of template parameter 'KeyEqual' shadows template parameter
         typename KeyEqual = std::equal_to<Key>
         ^~~~~~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:23:9: note: template parameter 'KeyEqual' declared here
         typename KeyEqual = std::equal_to<Key>
         ^~~~~~~~
/in/driver/main.cpp:156:1: error: expected '}' at end of input
 }
 ^
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In member function 'HashTable<Key, Value, Hash, KeyEqual>& HashTable<Key, Value, Hash, KeyEqual>::operator=(const HashTable<Key, Value, Hash, KeyEqual>&)':
/in/hashtable.hpp:227:20: error: expected primary-expression before 'default'
     ~HashTable() = default;
                    ^~~~~~~
/in/hashtable.hpp:227:20: error: expected ';' before 'default'
/in/hashtable.hpp:229:22: error: a function-definition is not allowed here before '{' token
     Iterator begin() {
                      ^
/in/hashtable.hpp:236:20: error: a function-definition is not allowed here before '{' token
     Iterator end() {
                    ^
/in/hashtable.hpp:246:35: error: a function-definition is not allowed here before '{' token
     bool contains(const Key &key) {
                                   ^
/in/hashtable.hpp:258:35: error: a function-definition is not allowed here before '{' token
     Iterator find(const Key &key) {
                                   ^
/in/hashtable.hpp:291:73: error: a function-definition is not allowed here before '{' token
     bool insert(const Iterator &it, const Key &key, const Value &value) {
                                                                         ^
/in/hashtable.hpp:327:53: error: a function-definition is not allowed here before '{' token
     bool insert(const Key &key, const Value &value) {
                                                     ^
/in/hashtable.hpp:340:32: error: a function-definition is not allowed here before '{' token
     bool erase(const Key &key) {
                                ^
/in/hashtable.hpp:360:40: error: a function-definition is not allowed here before '{' token
     Iterator erase(const Iterator &it) {
                                        ^
/in/hashtable.hpp:395:39: error: a function-definition is not allowed here before '{' token
     Value &operator[](const Key &key) {
                                       ^
/in/hashtable.hpp:425:36: error: a function-definition is not allowed here before '{' token
     void rehash(size_t bucketSize) {
                                    ^
/in/hashtable.hpp:451:25: error: a function-definition is not allowed here before '{' token
     size_t size() const { return tableSize; }
                         ^
/in/hashtable.hpp:456:31: error: a function-definition is not allowed here before '{' token
     size_t bucketSize() const { return buckets.size(); }
                               ^
/in/hashtable.hpp:461:31: error: a function-definition is not allowed here before '{' token
     double loadFactor() const { return (double) tableSize / (double) buckets.size(); }
                               ^
/in/hashtable.hpp:466:37: error: a function-definition is not allowed here before '{' token
     double getMaxLoadFactor() const { return maxLoadFactor; }
                                     ^
/in/hashtable.hpp:473:46: error: a function-definition is not allowed here before '{' token
     void setMaxLoadFactor(double loadFactor) {
                                              ^
/in/driver/main.cpp: In member function 'int HashTable<Key, Value, Hash, KeyEqual>::main(int, char**)':
/in/driver/main.cpp:156:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
/in/driver/main.cpp: At global scope:
/in/driver/main.cpp:156:1: error: expected ';' at end of input
cc1plus: all warnings being treated as errors

Information

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