+ 1

Custom class as key | unordered map

Hi Can someone suggest whats the error in code below: https://code.sololearn.com/c74pGRbpO1e8/?ref=app

18th Mar 2023, 6:50 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 Réponses
+ 7
line 20, the '&' is at the wrong location. Should be after the type test, not after the const (since you are using west side notation). Like this: size_t operator()(const test& t1)const fixes the code
18th Mar 2023, 8:46 PM
cacgs
+ 3
Thanks
19th Mar 2023, 3:53 AM
Ketan Lalcheta
Ketan Lalcheta - avatar