diff options
| author | Tyge Løvset <[email protected]> | 2022-04-09 00:14:50 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-09 00:14:50 +0200 |
| commit | 1a4223837d4e34a085f00e323759ee5f9cd81bd3 (patch) | |
| tree | 9be8cb543c9043fa885e511b86595c91ea1f4fc5 /include/stc/cstack.h | |
| parent | 03065ed6ef93f88003cd6754ca4d50ba20a76ebd (diff) | |
| download | STC-modified-1a4223837d4e34a085f00e323759ee5f9cd81bd3.tar.gz STC-modified-1a4223837d4e34a085f00e323759ee5f9cd81bd3.zip | |
Universally added a put() function to all containers.
Diffstat (limited to 'include/stc/cstack.h')
| -rw-r--r-- | include/stc/cstack.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/include/stc/cstack.h b/include/stc/cstack.h index bbf4613b..76103139 100644 --- a/include/stc/cstack.h +++ b/include/stc/cstack.h @@ -87,13 +87,11 @@ STC_INLINE _cx_value* _cx_memb(_push)(_cx_self* self, _cx_value val) { _cx_value* vp = self->data + self->size++;
*vp = val; return vp;
}
-STC_INLINE _cx_value* _cx_memb(_push_back)(_cx_self* self, _cx_value val)
+STC_INLINE _cx_value* _cx_memb(_put)(_cx_self* self, _cx_value val)
{ return _cx_memb(_push)(self, val); }
STC_INLINE void _cx_memb(_pop)(_cx_self* self)
{ _cx_value* p = &self->data[--self->size]; i_valdrop(p); }
-STC_INLINE void _cx_memb(_pop_back)(_cx_self* self)
- { _cx_memb(_pop)(self); }
STC_INLINE const _cx_value* _cx_memb(_at)(const _cx_self* self, size_t idx)
{ assert(idx < self->size); return self->data + idx; }
@@ -102,8 +100,6 @@ STC_INLINE const _cx_value* _cx_memb(_at)(const _cx_self* self, size_t idx) #if !defined _i_no_emplace
STC_INLINE _cx_value* _cx_memb(_emplace)(_cx_self* self, _cx_raw raw)
{ return _cx_memb(_push)(self, i_valfrom(raw)); }
-STC_INLINE _cx_value* _cx_memb(_emplace_back)(_cx_self* self, _cx_raw raw)
- { return _cx_memb(_push)(self, i_valfrom(raw)); }
#endif
STC_INLINE _cx_self _cx_memb(_clone)(_cx_self v) {
_cx_self out = {(_cx_value *) c_malloc(v.size*sizeof(_cx_value)), v.size, v.size};
|
