Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In member function 'size_t HashTable<Key, Value, Hash, KeyEqual>::findMinimumBucketSize(size_t) const':
/in/hashtable.hpp:200:89: error: no matching function for call to 'lower_bound(size_t&, const size_t*, size_t&)'
         auto it = std::lower_bound(size, HashPrime::g_a_sizes + distinct_size - 1, large);
                                                                                         ^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:984:5: note: candidate: template<class _ForwardIterator, class _Tp> _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)
     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_algobase.h:984:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:200:89: note:   deduced conflicting types for parameter '_ForwardIterator' ('long unsigned int' and 'const size_t* {aka const long unsigned int*}')
         auto it = std::lower_bound(size, HashPrime::g_a_sizes + distinct_size - 1, large);
                                                                                         ^
In file included from /usr/include/c++/7/functional:64:0,
                 from /in/hashtable.hpp:4,
                 from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/stl_algo.h:2023:5: note: candidate: template<class _FIter, class _Tp, class _Compare> _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)
     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_algo.h:2023:5: note:   template argument deduction/substitution failed:
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:200:89: note:   deduced conflicting types for parameter '_FIter' ('long unsigned int' and 'const size_t* {aka const long unsigned int*}')
         auto it = std::lower_bound(size, HashPrime::g_a_sizes + distinct_size - 1, large);
                                                                                         ^
/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:452: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:351: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:371: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:198:16: error: invalid conversion from 'const size_t* {aka const long unsigned int*}' to 'size_t {aka long unsigned int}' [-fpermissive]
         size_t size = HashPrime::g_a_sizes;
                ^~~~

Information

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