Skip to content

Commit

Permalink
Add std::hash specialization for event_type
Browse files Browse the repository at this point in the history
This is supposed to be in the standard library in C++14 but gcc 5.3
lacks it.
  • Loading branch information
jbytheway committed Sep 4, 2019
1 parent cb18219 commit 89b61f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ std::string enum_to_string<event_type>( event_type data );

} // namespace io

namespace std
{

template<>
struct hash<event_type> {
size_t operator()( const event_type v ) const noexcept {
return static_cast<size_t>( v );
}
};

} // namespace std

namespace cata
{

Expand Down

0 comments on commit 89b61f1

Please sign in to comment.