summaryrefslogtreecommitdiffhomepage
path: root/include/stc/clist.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-07 00:42:38 +0200
committerTyge Løvset <[email protected]>2022-04-07 00:42:38 +0200
commit03e36c56d8f61a6cbf2ca124134915999594fc91 (patch)
tree475d3b0ed1acf9809ba7483d912d2f0bdb356c38 /include/stc/clist.h
parent3fea4e0b232f7371628944587e561626503fb5fb (diff)
downloadSTC-modified-03e36c56d8f61a6cbf2ca124134915999594fc91.tar.gz
STC-modified-03e36c56d8f61a6cbf2ca124134915999594fc91.zip
Partly reverted (auto defined _i_no_emplace): emplace functions only available when either i_valraw or i_keyraw was defined. Avoids potensial bugs.
Diffstat (limited to 'include/stc/clist.h')
-rw-r--r--include/stc/clist.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h
index e035d830..5591c93a 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -115,7 +115,7 @@ _cx_memb(_copy)(_cx_self *self, _cx_self other) {
if (self->last == other.last) return;
_cx_memb(_drop)(self); *self = _cx_memb(_clone)(other);
}
-
+#if !defined _i_no_emplace
STC_INLINE _cx_value* _cx_memb(_emplace_back)(_cx_self* self, i_valraw raw)
{ return _cx_memb(_push_back)(self, i_valfrom(raw)); }
STC_INLINE _cx_value* _cx_memb(_emplace_front)(_cx_self* self, i_valraw raw)
@@ -123,6 +123,7 @@ STC_INLINE _cx_value* _cx_memb(_emplace_front)(_cx_self* self, i_valraw raw)
STC_INLINE _cx_iter _cx_memb(_emplace)(_cx_self* self, _cx_iter it, i_valraw raw)
{ return _cx_memb(_insert)(self, it, i_valfrom(raw)); }
#endif
+#endif
STC_INLINE _cx_self _cx_memb(_init)(void) { return c_make(_cx_self){NULL}; }
STC_INLINE bool _cx_memb(_reserve)(_cx_self* self, size_t n) { return true; }