Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of '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:333:15:   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:311:17: error: conversion to 'double' from 'size_t {aka long unsigned int}' may alter its value [-Werror=conversion]
             if (tableSize>=maxLoadFactor*(int)buckets.size()){
                 ^~~~~~~~~
/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:412: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:333:15:   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:174:92: error: conversion to 'double' from 'long unsigned int' may alter its value [-Werror=conversion]
                   *std::lower_bound(&HashPrime::g_a_sizes[0],&HashPrime::g_a_sizes[61],int(tableSize/maxLoadFactor)+1)?
                                                                                            ^~~~~~~~~
/in/hashtable.hpp:176:92: error: conversion to 'double' from 'long unsigned int' may alter its value [-Werror=conversion]
                   *std::lower_bound(&HashPrime::g_a_sizes[0],&HashPrime::g_a_sizes[61],int(tableSize/maxLoadFactor)+1);
                                                                                            ^~~~~~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 2
Language
C++
Submit At
2022-06-25 00:54:15
Judged At
2022-06-25 00:54:15
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes