summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cvec.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc/cvec.h')
-rw-r--r--include/stc/cvec.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index 874f4f47..71787733 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -133,7 +133,9 @@ STC_INLINE _cx_value* _cx_memb(_front)(const _cx_self* self) { return self->da
STC_INLINE _cx_value* _cx_memb(_back)(const _cx_self* self)
{ return self->data + self->_len - 1; }
STC_INLINE void _cx_memb(_pop)(_cx_self* self)
- { assert(!_cx_memb(_empty)(self)); _cx_value* p = &self->data[--self->_len]; i_keydrop(p); }
+ { assert(self->_len); _cx_value* p = &self->data[--self->_len]; i_keydrop(p); }
+STC_INLINE _cx_value _cx_memb(_pull)(_cx_self* self)
+ { assert(self->_len); return self->data[--self->_len]; }
STC_INLINE _cx_value* _cx_memb(_push_back)(_cx_self* self, i_key value)
{ return _cx_memb(_push)(self, value); }
STC_INLINE void _cx_memb(_pop_back)(_cx_self* self) { _cx_memb(_pop)(self); }