Record Detail

Compile Error

In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: In instantiation of '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:248:27: error: binding reference of type 'int&' to 'const int' discards qualifiers
         return find(key)->second;
                ~~~~~~~~~~~^~~~~~
/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:216: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:199:24: error: assignment of member 'std::pair<const int, int>::second' in read-only object
             it->second = value; // Обратите внимание, что это теперь безопасно
             ~~~~~~~~~~~^~~~~~~

Information

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