summaryrefslogtreecommitdiffhomepage
path: root/opentrack/simple-mat.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-08-22 20:23:35 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-08-22 20:23:35 +0200
commit48339aa148200f0f9cdf8ff61b17413ff1dacc87 (patch)
tree4dcb22f022fce86b84f7d6c9ba4dc2278fbe101c /opentrack/simple-mat.hpp
parent85c24dd0e030c2a2af44fdcf323a02a1dfae512e (diff)
simple-mat: can use static_cast here
Diffstat (limited to 'opentrack/simple-mat.hpp')
-rw-r--r--opentrack/simple-mat.hpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/opentrack/simple-mat.hpp b/opentrack/simple-mat.hpp
index 2b4cb72e..ca60c54d 100644
--- a/opentrack/simple-mat.hpp
+++ b/opentrack/simple-mat.hpp
@@ -68,12 +68,6 @@ class Mat
static_assert(h_ > 0 && w_ > 0, "must have positive mat dimensions");
- struct cast
- {
- template<typename u>
- static num _(u x) { return static_cast<num>(x); }
- };
-
Mat(std::initializer_list<num>&& xs) = delete;
public:
@@ -205,7 +199,7 @@ public:
template<typename... ts, typename = typename std::enable_if<is_arglist_correct<num, h_, w_, ts...>::value>>
Mat(ts const&... xs)
{
- const std::initializer_list<num> init = { cast::_(xs)... };
+ const std::initializer_list<num> init = { static_cast<num>(xs)... };
auto iter = init.begin();
for (int j = 0; j < h_; j++)
for (int i = 0; i < w_; i++)