diff --git a/library/include/df/custom/hash/labor_kitchen_interface_food_key.h b/library/include/df/custom/hash/labor_kitchen_interface_food_key.h index 4386621a6a..b1fdd73fdb 100644 --- a/library/include/df/custom/hash/labor_kitchen_interface_food_key.h +++ b/library/include/df/custom/hash/labor_kitchen_interface_food_key.h @@ -1,16 +1,26 @@ -template<> -struct std::hash<> { - auto operator()(const df::labor_kitchen_interface_food_key &a) const -> size_t { - struct thing { - int16_t t; - int16_t st; - int32_t x; - } thing{ - .t = a.type; - .st = a.subtype, - .x = static_cast(a.mat) ^ (static_cast(a.matg)) - }; +#include +#include +#include "df/labor_kitchen_interface_food_key.h" - return hash()(bit_cast(thing)); +namespace std +{ + template<> + struct hash + { + auto operator()(const df::labor_kitchen_interface_food_key& a) const -> size_t + { + struct thing + { + int16_t t; + int16_t st; + int32_t x; + } thing{ + .t = a.type, + .st = a.subtype, + .x = static_cast(a.mat) ^ (static_cast(a.matg)) + }; + + return hash()(std::bit_cast(thing)); } }; +}