(partially) Specialize `std::hash` for `graph::Index` class.
This will enable having Index as the key in "std::unordered_.."
containers.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
#ifndef __NEURUN_GRAPH_INDEX_H__
#define __NEURUN_GRAPH_INDEX_H__
+#include <functional>
#include <stdint.h>
namespace neurun
} // namespace graph
} // namespace neurun
+namespace std
+{
+
+template <typename T, typename Tag> struct hash<::neurun::graph::Index<T, Tag>>
+{
+ size_t operator()(const ::neurun::graph::Index<T, Tag> &index) const noexcept
+ {
+ return hash<T>()(index.value());
+ }
+};
+
+} // namespace std
+
#endif // __NEURUN_GRAPH_INDEX_H__