diff options
Diffstat (limited to 'include/vector2d.h')
-rw-r--r-- | include/vector2d.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/vector2d.h b/include/vector2d.h index 08672a3..a0eb7ea 100644 --- a/include/vector2d.h +++ b/include/vector2d.h @@ -8,6 +8,8 @@ #include "irrMath.h"
#include "dimension2d.h"
+#include <functional>
+
namespace irr
{
namespace core
@@ -414,5 +416,21 @@ public: } // end namespace core
} // end namespace irr
+namespace std
+{
+
+template<class T>
+struct hash<irr::core::vector2d<T> >
+{
+ size_t operator()(const irr::core::vector2d<T>& vec) const
+ {
+ size_t h1 = hash<T>()(vec.X);
+ size_t h2 = hash<T>()(vec.Y);
+ return (h1 << (4 * sizeof(h1)) | h1 >> (4 * sizeof(h1))) ^ h2;
+ }
+};
+
+}
+
#endif
|