Record Detail

Compile Error

/in/driver/main.cpp: In function 'int main(int, char**)':
/in/driver/main.cpp:78:33: error: 'class HashTableTest<int, int>' has no member named 'bucketSize'; did you mean 'bucket_index'?
     size_t hashTableSize = Test.bucketSize();
                                 ^~~~~~~~~~
                                 bucket_index
/in/driver/main.cpp:92:26: error: 'class HashTableTest<int, int>' has no member named 'contains'
                 if (Test.contains(key)){
                          ^~~~~~~~
/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:99:10: note: candidate: bool HashTable<Key, Value, Hash, KeyEqual>::insert(const HashNode&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; HashTable<Key, Value, Hash, KeyEqual>::HashNode = std::pair<const int, int>]
     bool insert(const HashNode& node) {
          ^~~~~~
/in/hashtable.hpp:99:10: note:   candidate expects 1 argument, 2 provided
/in/driver/main.cpp:139:18: error: 'class HashTableTest<int, int>' has no member named 'bucketSize'; did you mean 'bucket_index'?
         if (Test.bucketSize() != hashTableSize){
                  ^~~~~~~~~~
                  bucket_index
/in/driver/main.cpp:140:111: error: 'class HashTableTest<int, int>' has no member named 'bucketSize'; did you mean 'bucket_index'?
             message += " Rehashed table from " + std::to_string(hashTableSize) + " to " + std::to_string(Test.bucketSize()) + ".";
                                                                                                               ^~~~~~~~~~
                                                                                                               bucket_index
/in/driver/main.cpp:141:34: error: 'class HashTableTest<int, int>' has no member named 'bucketSize'; did you mean 'bucket_index'?
             hashTableSize = Test.bucketSize();
                                  ^~~~~~~~~~
                                  bucket_index
In file included from /in/driver/main.cpp:5:0:
/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:93:24: error: no matching function for call to 'HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::Iterator(__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> > > > > >, 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> > > > >::iterator, std::_Fwd_list_iterator<std::pair<const int, int> >&)'
                 return Iterator(table_.begin() + index, table_.end(), it);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/hashtable.hpp:43:9: note: candidate: HashTable<Key, Value, Hash, KeyEqual>::Iterator::Iterator(HashTable<Key, Value, Hash, KeyEqual>::Iterator::VectorIterator, HashTable<Key, Value, Hash, KeyEqual>::Iterator::VectorIterator) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; HashTable<Key, Value, Hash, KeyEqual>::Iterator::VectorIterator = __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> > > > > >]
         Iterator(VectorIterator vecIt, VectorIterator vecEnd)
         ^~~~~~~~
/in/hashtable.hpp:43:9: note:   candidate expects 2 arguments, 3 provided
/in/hashtable.hpp:33:11: note: candidate: constexpr HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::Iterator(const HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator&)
     class Iterator {
           ^~~~~~~~
/in/hashtable.hpp:33:11: note:   candidate expects 1 argument, 3 provided
/in/hashtable.hpp:33:11: note: candidate: constexpr HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator::Iterator(HashTable<int, int, std::hash<int>, std::equal_to<int> >::Iterator&&)
/in/hashtable.hpp:33:11: note:   candidate expects 1 argument, 3 provided
/in/driver/main.cpp: In instantiation of 'void HashTableTest<Key, Value, Hash, KeyEqual>::print() [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>]':
/in/driver/main.cpp:150:20:   required from here
/in/driver/main.cpp:46:36: error: 'class HashTableTest<int, int>' has no member named 'buckets'
         for (auto BucketIt = this->buckets.begin(); BucketIt != this->buckets.end(); BucketIt++){
                              ~~~~~~^~~~~~~
/in/driver/main.cpp:46:71: error: 'class HashTableTest<int, int>' has no member named 'buckets'
         for (auto BucketIt = this->buckets.begin(); BucketIt != this->buckets.end(); BucketIt++){
                                                                 ~~~~~~^~~~~~~
/in/driver/main.cpp:51:13: error: unable to deduce 'auto&&' from 'bucket'
             for ( const auto &p : bucket )
             ^~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of 'bool HashTable<Key, Value, Hash, KeyEqual>::insert(const HashNode&) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; HashTable<Key, Value, Hash, KeyEqual>::HashNode = std::pair<const int, int>]':
/in/hashtable.hpp:126:19:   required from '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:101:56: error: conversion to 'double' from 'long unsigned int' may alter its value [-Werror=conversion]
         if (size_ >= HashPrime::g_a_sizes[primeIndex_] * 0.75) {
/in/hashtable.hpp:101:13: error: conversion to 'double' from 'size_t {aka long unsigned int}' may alter its value [-Werror=conversion]
         if (size_ >= HashPrime::g_a_sizes[primeIndex_] * 0.75) {
             ^~~~~
cc1plus: all warnings being treated as errors

Information

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