Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of 'void HashTable<Key, Value, Hash, KeyEqual>::rehash(size_t) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; size_t = long unsigned int]':
/in/hashtable.hpp:288:19:   required from 'bool HashTable<Key, Value, Hash, KeyEqual>::insert(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:310: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:390:13: error: no matching function for call to 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::insert(HashTable<int, int, std::hash<int>, std::equal_to<int> >::HashNode&, HashTable<int, int, std::hash<int>, std::equal_to<int> >::HashNode*)'
             newTable.insert((*it), &(*it));
             ^~~~~~~~
/in/hashtable.hpp:275:10: note: candidate: bool HashTable<Key, Value, Hash, KeyEqual>::insert(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(Iterator &it, const Key &key, const Value &value) {
          ^~~~~~
/in/hashtable.hpp:275:10: note:   candidate expects 3 arguments, 2 provided
/in/hashtable.hpp:307:10: note: candidate: 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>]
     bool insert(const Key &key, const Value &value) {
          ^~~~~~
/in/hashtable.hpp:307:10: note:   no known conversion for argument 1 from 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::HashNode {aka std::pair<const int, int>}' to 'const int&'
/in/hashtable.hpp:393:13: error: lvalue required as left operand of assignment
         this=newTable;
         ~~~~^~~~~~~~~
/in/hashtable.hpp: In instantiation of 'size_t HashTable<Key, Value, Hash, KeyEqual>::findMinimumBucketSize(size_t) const [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; size_t = long unsigned int]':
/in/hashtable.hpp:384:43:   required from 'void HashTable<Key, Value, Hash, KeyEqual>::rehash(size_t) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; size_t = long unsigned int]'
/in/hashtable.hpp:288:19:   required from 'bool HashTable<Key, Value, Hash, KeyEqual>::insert(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:310: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:175:31: error: conversion to 'double' from 'long unsigned int' may alter its value [-Werror=conversion]
                 > std::floor((tableSize / maxLoadFactor))){
                               ^~~~~~~~~
/in/hashtable.hpp:175:17: error: conversion to 'double' from 'long unsigned int' may alter its value [-Werror=conversion]
                 > std::floor((tableSize / maxLoadFactor))){
cc1plus: all warnings being treated as errors

Information

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