From 5b096ed179709810224cc21614b5a3e5d4d74e50 Mon Sep 17 00:00:00 2001 From: rikki cattermole Date: Sun, 4 Jan 2015 22:43:25 +1300 Subject: [PATCH] Bug fix, so Vector types can be used as a key in an AA --- gl3n/linalg.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gl3n/linalg.d b/gl3n/linalg.d index 9491455..c7675b1 100644 --- a/gl3n/linalg.d +++ b/gl3n/linalg.d @@ -63,6 +63,11 @@ struct Vector(type, int dimension_) { } alias as_string toString; /// ditto + // Returns the hash. Requires TypeInfo_Struct to get the hash. + size_t toHash() const nothrow @safe { + return typeid(typeof(this)).getHash(&this); + } + @safe pure nothrow: /// private @property ref inout(vt) get_(char coord)() inout {