summaryrefslogtreecommitdiffhomepage
path: root/compat/simple-mat.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-05-25 16:44:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-05-25 16:44:57 +0200
commit4abd3763d8ce650469cee83ce1f413ce4ec43164 (patch)
treed97cf747ed2311407024cdb227b9f910ae49e973 /compat/simple-mat.hpp
parent4029ee060339551fe885c21a297efad0f8dd864e (diff)
compat: fix -Wdeprecated-copy
Found with GCC 9.1
Diffstat (limited to 'compat/simple-mat.hpp')
-rw-r--r--compat/simple-mat.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/compat/simple-mat.hpp b/compat/simple-mat.hpp
index 01af1c99..e697f76a 100644
--- a/compat/simple-mat.hpp
+++ b/compat/simple-mat.hpp
@@ -244,6 +244,13 @@ public:
data[j][i] = mem[i*H+j];
}
+ constexpr Mat(const Mat<num, H, W>& x)
+ {
+ for (int j = 0; j < H; j++)
+ for (int i = 0; i < W; i++)
+ data[j][i] = x(j, i);
+ }
+
constexpr operator num*() & { return (num*)data; }
constexpr operator const num*() const& { return (const num*)data; }