summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cstack.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-18 09:11:26 +0200
committerGitHub <[email protected]>2022-08-18 09:11:26 +0200
commite774adc245c74341ec5c4318de0dfd24a42b21e5 (patch)
treeab7b16872e2a2356cf3fc9d69a3323e994a8bed2 /include/stc/cstack.h
parentbd85ecdd0ba00c15a2fa093e0896367ac0d48514 (diff)
parentc5144785aaac11a30439064decabef62968b00a4 (diff)
downloadSTC-modified-e774adc245c74341ec5c4318de0dfd24a42b21e5.tar.gz
STC-modified-e774adc245c74341ec5c4318de0dfd24a42b21e5.zip
Merge pull request #35 from tylov/iter_exp_dont_use
Some API updates cstr, csview with utf8. Added front()/back() to cstack.
Diffstat (limited to 'include/stc/cstack.h')
-rw-r--r--include/stc/cstack.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/stc/cstack.h b/include/stc/cstack.h
index e1839d37..9ed2beda 100644
--- a/include/stc/cstack.h
+++ b/include/stc/cstack.h
@@ -120,6 +120,12 @@ STC_INLINE void _cx_memb(_shrink_to_fit)(_cx_self* self)
STC_INLINE const _cx_value* _cx_memb(_top)(const _cx_self* self)
{ return &self->data[self->size - 1]; }
+STC_INLINE _cx_value* _cx_memb(_back)(const _cx_self* self)
+ { return (_cx_value*) &self->data[self->size - 1]; }
+
+STC_INLINE _cx_value* _cx_memb(_front)(const _cx_self* self)
+ { return (_cx_value*) &self->data[0]; }
+
STC_INLINE _cx_value* _cx_memb(_push)(_cx_self* self, _cx_value val) {
if (self->size == _cx_memb(_capacity)(self))
if (!_cx_memb(_reserve)(self, self->size*3/2 + 4))