summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cpque.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-01 18:08:58 +0200
committerTyge Løvset <[email protected]>2022-04-01 18:08:58 +0200
commitb707e18ae93c60f2b659bad39f1daf54604445f7 (patch)
treef7e36cd70513fd72159fe52ea609c79b6e1112d4 /include/stc/cpque.h
parent39dce2065ce5b6b8de5d52d788effe70372e6d47 (diff)
downloadSTC-modified-b707e18ae93c60f2b659bad39f1daf54604445f7.tar.gz
STC-modified-b707e18ae93c60f2b659bad39f1daf54604445f7.zip
Simplified internal logic on enabling default cloning
Diffstat (limited to 'include/stc/cpque.h')
-rw-r--r--include/stc/cpque.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/stc/cpque.h b/include/stc/cpque.h
index 159cbf06..d8480a17 100644
--- a/include/stc/cpque.h
+++ b/include/stc/cpque.h
@@ -88,7 +88,7 @@ STC_INLINE _cx_value* _cx_memb(_top)(const _cx_self* self)
STC_INLINE void _cx_memb(_pop)(_cx_self* self)
{ _cx_memb(_erase_at)(self, 0); }
-#if !c_option(c_no_clone)
+#if !defined _i_no_from
STC_API _cx_self _cx_memb(_clone)(_cx_self q);
STC_INLINE void _cx_memb(_copy)(_cx_self *self, _cx_self other) {
@@ -98,11 +98,9 @@ STC_INLINE void _cx_memb(_copy)(_cx_self *self, _cx_self other) {
STC_INLINE i_val _cx_memb(_value_clone)(_cx_value val)
{ return i_valfrom(i_valto(&val)); }
-#if !defined _i_no_raw
STC_INLINE void _cx_memb(_emplace)(_cx_self* self, _cx_raw raw)
{ _cx_memb(_push)(self, i_valfrom(raw)); }
#endif
-#endif
/* -------------------------- IMPLEMENTATION ------------------------- */
#if defined(_i_implement)
@@ -124,7 +122,7 @@ _cx_memb(_make_heap)(_cx_self* self) {
_cx_memb(_sift_down_)(arr, k, n);
}
-#if !c_option(c_no_clone)
+#if !defined _i_no_from
STC_DEF _cx_self _cx_memb(_clone)(_cx_self q) {
_cx_self out = _cx_memb(_with_capacity)(q.size);
for (; out.size < out.capacity; ++out.size, ++q.data)