Record Detail

Compile Error

/in/driver/main.cpp: In function 'int main(int, char**)':
/in/driver/main.cpp:111:43: error: no matching function for call to 'HashTableTest<int, int>::insert(int&, int&)'
                 if (Test.insert(key, value)){
                                           ^
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:269:10: note: candidate: 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>]
     bool insert(const Iterator &it, const Key &key, const Value &value) {
          ^~~~~~
/in/hashtable.hpp:269:10: note:   candidate expects 3 arguments, 2 provided
/in/driver/main.cpp:129:90: error: no match for 'operator[]' (operand types are 'HashTableTest<int, int>' and 'int')
                 message = "Accessed (" + std::to_string(key) + ", " + std::to_string(Test[key]) + "); ";
                                                                                          ^
/in/driver/main.cpp:130:21: error: no match for 'operator[]' (operand types are 'HashTableTest<int, int>' and 'int')
                 Test[key] = value;
                     ^
/in/driver/main.cpp:131:93: error: no match for 'operator[]' (operand types are 'HashTableTest<int, int>' and 'int')
                 message += "Updated to (" + std::to_string(key) + ", " + std::to_string(Test[key]) + ").";;
                                                                                             ^

Information

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