Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/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:420: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:312:23:   required from '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>]'
/in/hashtable.hpp:340: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:172:47: error: passing 'const HashTable<int, int, std::hash<int>, std::equal_to<int> >' as 'this' argument discards qualifiers [-fpermissive]
                                  bigbucketsize(bucketSize));
                                  ~~~~~~~~~~~~~^~~~~~~~~~~~
/in/hashtable.hpp:181:12: note:   in call to 'size_t HashTable<Key, Value, Hash, KeyEqual>::bigbucketsize(size_t) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; size_t = long unsigned int]'
     size_t bigbucketsize(size_t bucketsize){
            ^~~~~~~~~~~~~
/in/hashtable.hpp: In instantiation of 'size_t HashTable<Key, Value, Hash, KeyEqual>::bigbucketsize(size_t) [with Key = int; Value = int; Hash = std::hash<int>; KeyEqual = std::equal_to<int>; size_t = long unsigned int]':
/in/hashtable.hpp:172:47:   required from '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:420: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:312:23:   required from '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>]'
/in/hashtable.hpp:340: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:182:22: error: conversion to 'double' from 'size_t {aka long unsigned int}' may alter its value [-Werror=conversion]
         size_t n=size()/getMaxLoadFactor()+1;
                  ~~~~^~
/in/hashtable.hpp:182:43: error: conversion to 'size_t {aka long unsigned int}' from 'double' may alter its value [-Werror=float-conversion]
         size_t n=size()/getMaxLoadFactor()+1;
                  ~~~~~~~~~~~~~~~~~~~~~~~~~^~
cc1plus: all warnings being treated as errors

Information

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