From 057cf55a2a24477251fc947db6981fc8f1a6cfe6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 29 Apr 2017 16:04:49 +0200 Subject: compat/simple-mat: initialize like a single-dimensional array I have no idea why this works. --- compat/simple-mat.hpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/compat/simple-mat.hpp b/compat/simple-mat.hpp index fbd0a75e..a119044c 100644 --- a/compat/simple-mat.hpp +++ b/compat/simple-mat.hpp @@ -193,13 +193,9 @@ public: template::value>::type> - Mat(const ts... xs) + Mat(const ts... xs) : data{static_cast(xs)...} { static_assert(h__ == h_ && w__ == w_, ""); - - std::initializer_list init = { static_cast(xs)... }; - - *this = Mat(std::move(init)); } Mat() @@ -216,14 +212,6 @@ public: data[j][i] = mem[i*h_+j]; } - Mat(std::initializer_list&& init) - { - auto iter = init.begin(); - for (int j = 0; j < h_; j++) - for (int i = 0; i < w_; i++) - data[j][i] = *iter++; - } - operator num*() { return reinterpret_cast(data); } operator const num*() const { return reinterpret_cast(data); } -- cgit v1.2.3