summaryrefslogtreecommitdiffhomepage
path: root/include/stc/clist.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-22 12:20:31 +0200
committerTyge Løvset <[email protected]>2022-04-22 12:20:31 +0200
commit8f57f3d331de4cb4aa7d06862c2de3424eb1ba5b (patch)
tree1a730578475e4d6e260948578cd0c2a5fd4463f4 /include/stc/clist.h
parent182099800f230f876fb46dac9f1f49a4fe3c3981 (diff)
downloadSTC-modified-8f57f3d331de4cb4aa7d06862c2de3424eb1ba5b.tar.gz
STC-modified-8f57f3d331de4cb4aa7d06862c2de3424eb1ba5b.zip
Readded push()/emplace() to all containers missing them. Made _hash function required for i_key_bind, _eq is derived from _cmp.
Diffstat (limited to 'include/stc/clist.h')
-rw-r--r--include/stc/clist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h
index 8247b04a..33aa6feb 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -122,6 +122,8 @@ STC_INLINE _cx_value* _cx_memb(_emplace_front)(_cx_self* self, i_keyraw raw)
{ return _cx_memb(_push_front)(self, i_keyfrom(raw)); }
STC_INLINE _cx_iter _cx_memb(_emplace_at)(_cx_self* self, _cx_iter it, i_keyraw raw)
{ return _cx_memb(_insert_at)(self, it, i_keyfrom(raw)); }
+STC_INLINE _cx_value* _cx_memb(_emplace)(_cx_self* self, i_keyraw raw)
+ { return _cx_memb(_push_back)(self, i_keyfrom(raw)); }
#endif // !_i_no_emplace
#endif // !_i_no_clone
@@ -131,6 +133,8 @@ STC_INLINE bool _cx_memb(_empty)(_cx_self cx) { return cx.last == NULL;
STC_INLINE size_t _cx_memb(_count)(_cx_self cx)
{ return _clist_count((const clist_VOID*) &cx); }
STC_INLINE void _cx_memb(_clear)(_cx_self* self) { _cx_memb(_drop)(self); }
+STC_INLINE _cx_value* _cx_memb(_push)(_cx_self* self, i_key value)
+ { return _cx_memb(_push_back)(self, value); }
STC_INLINE void _cx_memb(_pop_front)(_cx_self* self)
{ _cx_memb(_erase_after_)(self, self->last); }
STC_INLINE _cx_value* _cx_memb(_front)(const _cx_self* self) { return &self->last->next->value; }