Ask Your Question
2

What is the meaning of the error message "std::unordered_map' with Key class" and why is it indicating that a function has been deleted?

asked 2022-10-24 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-06-06 15:00:00 +0000

scrum gravatar image

The error message "std::unorderedmap' with Key class" indicates that there is an issue with using an object of a particular class as a key in a std::unorderedmap. The error message is usually accompanied by a note that the compiler has deleted a function. This is because the use of the class as a key requires the class to have a valid hash function and a valid equality operator. If the class does not define these functions, then the compiler will automatically delete the default functions. The error message is a way of telling the programmer that they need to define these functions in order to use the class as a key in the unordered_map.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-10-24 11:00:00 +0000

Seen: 10 times

Last updated: Jun 06 '21