Skip to content

Commit

Permalink
Add hash function for ToolKey
Browse files Browse the repository at this point in the history
... to support older compilers.
  • Loading branch information
abau committed Jun 10, 2018
1 parent 62d0e48 commit db5394e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/src/tool/key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef DILAY_TOOL_KEY
#define DILAY_TOOL_KEY

#include <functional>

enum class ToolKey
{
TransformMesh,
Expand All @@ -26,4 +28,12 @@ enum class ToolKey
MoveCamera
};

namespace std
{
template <> struct hash<ToolKey>
{
size_t operator() (const ToolKey& key) const { return std::hash<int> () (int(key)); }
};
}

#endif

0 comments on commit db5394e

Please sign in to comment.