summaryrefslogtreecommitdiffhomepage
path: root/include/stc/carr3.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc/carr3.h')
-rw-r--r--include/stc/carr3.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/stc/carr3.h b/include/stc/carr3.h
index 1e11b03e..45b57acc 100644
--- a/include/stc/carr3.h
+++ b/include/stc/carr3.h
@@ -81,6 +81,11 @@ STC_INLINE cx_value_t* cx_memb(_data)(Self* self)
STC_INLINE cx_value_t* cx_memb(_at)(Self* self, size_t x, size_t y, size_t z)
{ return **self->data + self->zdim*(self->ydim*x + y) + z; }
+STC_INLINE void cx_memb(_copy)(Self *self, Self other) {
+ if (self->data == other.data) return;
+ cx_memb(_del)(self); *self = cx_memb(_clone)(other);
+}
+
STC_INLINE cx_iter_t cx_memb(_begin)(const Self* self)
{ return c_make(cx_iter_t){**self->data}; }