summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc/cmap.h')
-rw-r--r--include/stc/cmap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/stc/cmap.h b/include/stc/cmap.h
index 096a7045..763764b7 100644
--- a/include/stc/cmap.h
+++ b/include/stc/cmap.h
@@ -272,6 +272,11 @@ STC_DEF void cx_memb(_clear)(Self* self) {
memset(self->_hashx, 0, self->bucket_count);
}
+STC_INLINE void cx_memb(_copy)(Self *self, Self other) {
+ if (self->table == other.table) return;
+ cx_memb(_del)(self); *self = cx_memb(_clone)(other);
+}
+
cx_MAP_ONLY(
STC_DEF cx_result_t
cx_memb(_insert_or_assign)(Self* self, i_key _key, i_val _mapped) {