# HG changeset patch # User Rik # Date 1631505884 25200 # Node ID aedebbc6b765ffec27016ad1b4a165362946e580 # Parent 4412f57132c4282d7cf61ae25c67e7a78b0bee07 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. diff -r 4412f57132c4 -r aedebbc6b765 liboctave/array/MArray.cc --- 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 -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 -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