From eb24176b266e2406979ec4daf1c5ea73f356efef Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 28 Sep 2016 02:00:39 +0200 Subject: logic/simple-mat: add unsigned index accessors --- logic/simple-mat.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'logic') diff --git a/logic/simple-mat.hpp b/logic/simple-mat.hpp index 1d416e6b..089e8dfe 100644 --- a/logic/simple-mat.hpp +++ b/logic/simple-mat.hpp @@ -70,6 +70,18 @@ public: template typename std::enable_if::value, num&>::type inline operator()(int i) { return data[0][i]; } + template typename std::enable_if::value, num>::type + inline operator()(unsigned i) const { return data[i][0]; } + + template typename std::enable_if::value, num>::type + inline operator()(unsigned i) const { return data[0][i]; } + + template typename std::enable_if::value, num&>::type + inline operator()(unsigned i) { return data[i][0]; } + + template typename std::enable_if::value, num&>::type + inline operator()(unsigned i) { return data[0][i]; } + #define OPENTRACK_ASSERT_SWIZZLE static_assert(P == h_ && Q == w_, "") template typename std::enable_if::value, num>::type @@ -176,6 +188,9 @@ public: inline num operator()(int j, int i) const { return data[j][i]; } inline num& operator()(int j, int i) { return data[j][i]; } + inline num operator()(unsigned j, unsigned i) const { return data[j][i]; } + inline num& operator()(unsigned j, unsigned i) { return data[j][i]; } + template::value>::type> Mat(const ts... xs) -- cgit v1.2.3