Skip to content

Commit 2c5e2bc

Browse files
authored
Inject custom specialization of std::hash for SporkId enum into std (#2960)
This should fix compilation on gcc5
1 parent 809aae7 commit 2c5e2bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/spork.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ enum SporkId : int32_t {
3737
};
3838
template<> struct is_serializable_enum<SporkId> : std::true_type {};
3939

40+
namespace std
41+
{
42+
template<> struct hash<SporkId>
43+
{
44+
std::size_t operator()(SporkId const& id) const noexcept
45+
{
46+
return std::hash<int>{}(id);
47+
}
48+
};
49+
}
50+
4051
struct CSporkDef
4152
{
4253
SporkId sporkId{SPORK_INVALID};

0 commit comments

Comments
 (0)