File tree Expand file tree Collapse file tree 1 file changed +23
-13
lines changed
library/include/df/custom/hash Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Original file line number Diff line number Diff line change 1- template <>
2- struct std ::hash<> {
3- auto operator ()(const df::labor_kitchen_interface_food_key &a) const -> size_t {
4- struct thing {
5- int16_t t;
6- int16_t st;
7- int32_t x;
8- } thing{
9- .t = a.type ;
10- .st = a.subtype ,
11- .x = static_cast <int32_t >(a.mat ) ^ (static_cast <int32_t >(a.matg ))
12- };
1+ #include < functional>
2+ #include < bit>
3+ #include " df/labor_kitchen_interface_food_key.h"
134
14- return hash<int64_t >()(bit_cast<int64_t >(thing));
5+ namespace std
6+ {
7+ template <>
8+ struct hash <df::labor_kitchen_interface_food_key>
9+ {
10+ auto operator ()(const df::labor_kitchen_interface_food_key& a) const -> size_t
11+ {
12+ struct thing
13+ {
14+ int16_t t;
15+ int16_t st;
16+ int32_t x;
17+ } thing{
18+ .t = a.type ,
19+ .st = a.subtype ,
20+ .x = static_cast <int32_t >(a.mat ) ^ (static_cast <int32_t >(a.matg ))
21+ };
22+
23+ return hash<int64_t >()(std::bit_cast<int64_t >(thing));
1524 }
1625 };
26+ }
You can’t perform that action at this time.
0 commit comments