I want to create an unordered map using set. but this error apear "error: static assertion failed: hash function must be invocable with an argument of key type|" can anyone write hasher code?
Asked
Active
Viewed 109 times
0
-
TL;DR of the dupe. There is no `std::hash` specialization for `std::set`. You need to provide your own hasher – NathanOliver Jan 22 '21 at 13:44
-
@NathanOliver how? – mado HK Jan 22 '21 at 13:59
-
See https://stackoverflow.com/questions/8157937/how-to-specialize-stdhashkeyoperator-for-user-defined-type-in-unordered – NathanOliver Jan 22 '21 at 14:01