From 630c5e98558e498941212e486e1b08e8e282d3b0 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 27 Apr 2022 15:41:57 +0200 Subject: Removed cbox_X_make() and carc_X_make() when i_rawval was not defined, i.e. like emplace is removed in other containers. --- include/stc/carc.h | 4 ++-- include/stc/cbox.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/stc/carc.h b/include/stc/carc.h index 80b9a879..02b932af 100644 --- a/include/stc/carc.h +++ b/include/stc/carc.h @@ -143,12 +143,12 @@ _cx_memb(_reset_from)(_cx_self* self, i_key val) { *self = _cx_memb(_from)(val); } -#if !defined _i_no_clone +#if !defined _i_no_clone && !defined _i_no_emplace STC_INLINE _cx_self _cx_memb(_make)(_cx_raw raw) { return _cx_memb(_from)(i_keyfrom(raw)); } #endif // !_i_no_clone -// does not use i_keyfrom, so we can bypass c_no_clone +// does not use i_keyclone, so OK to always define. STC_INLINE _cx_self _cx_memb(_clone)(_cx_self ptr) { if (ptr.use_count) _i_atomic_inc(ptr.use_count); diff --git a/include/stc/cbox.h b/include/stc/cbox.h index 780d6aaf..2d766509 100644 --- a/include/stc/cbox.h +++ b/include/stc/cbox.h @@ -122,9 +122,10 @@ _cx_memb(_reset_from)(_cx_self* self, i_key val) { } #if !defined _i_no_clone +#if !defined _i_no_emplace STC_INLINE _cx_self _cx_memb(_make)(_cx_raw raw) { return _cx_memb(_from)(i_keyfrom(raw)); } - +#endif STC_INLINE _cx_self _cx_memb(_clone)(_cx_self other) { if (!other.get) return other; -- cgit v1.2.3