From f0f18a08e2f4a82902098df8d54578811919fa67 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 11 Aug 2015 06:41:02 +0200 Subject: simple-mat: open-code more, add comment --- opentrack/simple-mat.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'opentrack') diff --git a/opentrack/simple-mat.hpp b/opentrack/simple-mat.hpp index 1d3b10e1..49bf4feb 100755 --- a/opentrack/simple-mat.hpp +++ b/opentrack/simple-mat.hpp @@ -47,6 +47,9 @@ template struct Mat { num data[h_][w_]; + + // parameters w_ and h_ are rebound so that SFINAE occurs + // removing them causes a compile-time error -sh 20150811 template typename std::enable_if::value, num>::type __inline operator()(int i) const { return data[i][0]; } @@ -108,7 +111,7 @@ struct Mat Mat ret; for (int j = 0; j < h_; j++) for (int i = 0; i < w_; i++) - ret(j, i) = data[j][i] + other(j, i); + ret(j, i) = data[j][i] + other.data[j][i]; return ret; } @@ -117,7 +120,7 @@ struct Mat Mat ret; for (int j = 0; j < h_; j++) for (int i = 0; i < w_; i++) - ret(j, i) = data[j][i] - other(j, i); + ret(j, i) = data[j][i] - other.data[j][i]; return ret; } -- cgit v1.2.3