changeset 30164:aedebbc6b765

maint: Convert structs _idxadds_helpe, _idxadda_helper to classes. * MArray.cc: Change type of _idxadds_helper, _idxadda_helper from struct to class. Place member variables in new private section.
author Rik <rik@octave.org>
date Sun, 12 Sep 2021 21:04:44 -0700
parents 4412f57132c4
children 5933cf5415c4
files liboctave/array/MArray.cc
diffstat 1 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/array/MArray.cc	Sun Sep 12 20:57:27 2021 -0700
+++ b/liboctave/array/MArray.cc	Sun Sep 12 21:04:44 2021 -0700
@@ -32,33 +32,31 @@
 #include "lo-error.h"
 
 template <typename T>
-struct _idxadds_helper
+class _idxadds_helper
 {
 public:
-  _idxadds_helper (T *a, T v) : array (a), val (v) { }
+  _idxadds_helper (T *a, T v) : m_array (a), m_val (v) { }
 
   void operator () (octave_idx_type i)
-  { array[i] += val; }
+  { m_array[i] += m_val; }
 
-  //--------
-
-  T *array;
-  T val;
+private:
+  T *m_array;
+  T m_val;
 };
 
 template <typename T>
-struct _idxadda_helper
+class _idxadda_helper
 {
 public:
-  _idxadda_helper (T *a, const T *v) : array (a), vals (v) { }
+  _idxadda_helper (T *a, const T *v) : m_array (a), m_vals (v) { }
 
   void operator () (octave_idx_type i)
-  { array[i] += *vals++; }
+  { m_array[i] += *m_vals++; }
 
-  //--------
-
-  T *array;
-  const T *vals;
+private:
+  T *m_array;
+  const T *m_vals;
 };
 
 template <typename T>