From 6d98787e9e51b77907f4411506b48a9587b6aeac Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 7 Mar 2020 12:39:51 +0100 Subject: [PATCH] Change the arraynd size query API. Now size() returns the total number of elements, and sizes() returns an N-dimensional vector containing each size separately. --- legacy/lol/math/arraynd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/legacy/lol/math/arraynd.h b/legacy/lol/math/arraynd.h index 7973fcbc..7d635a05 100644 --- a/legacy/lol/math/arraynd.h +++ b/legacy/lol/math/arraynd.h @@ -236,7 +236,7 @@ public: resize_data(e); } - inline vec_t size() const + inline vec_t sizes() const { return vec_t(this->m_sizes); } @@ -244,8 +244,8 @@ public: public: inline element_t *data() { return m_data.data(); } inline element_t const *data() const { return m_data.data(); } - inline int total_size() const { return m_data.size(); } - inline size_t bytes() const { return total_size() * sizeof(element_t); } + inline size_t size() const { return m_data.size(); } + inline size_t bytes() const { return size() * sizeof(element_t); } private: inline void resize_data(element_t e = element_t())