summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-17 15:02:06 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-18 00:16:27 +0200
commitdd2bb6cc86d59f7b6600a2e75142470539dc8a71 (patch)
treefeeabc7f7db16901c40f9fafcb0bbc01a5770e22
parentcd2b2ffbf72c5bfc2e701d607252059b8d5f4a86 (diff)
api/simple-mat: allow for casts to num* and const
Due to memory layout we don't need enable_if for vector.
-rw-r--r--opentrack/simple-mat.hpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/opentrack/simple-mat.hpp b/opentrack/simple-mat.hpp
index ce2bccc5..f5680ec4 100644
--- a/opentrack/simple-mat.hpp
+++ b/opentrack/simple-mat.hpp
@@ -206,13 +206,8 @@ public:
Mat(num* mem) : Mat(const_cast<const num*>(mem)) {}
- template<int h = h_,
- int w = w_,
- typename = typename std::enable_if<h == 1 || w == 1>::type>
- operator const double*() const
- {
- return reinterpret_cast<const double*>(data);
- }
+ operator num*() { return reinterpret_cast<double*>(data); }
+ operator const num*() const { return reinterpret_cast<const double*>(data); }
// XXX add more operators as needed, third-party dependencies mostly
// not needed merely for matrix algebra -sh 20141030