diff options
| author | Tyge Løvset <[email protected]> | 2021-12-12 21:33:22 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-12 21:33:22 +0100 |
| commit | d57b9bb7666753c7cf7ab5a0da6d7d11f303c2af (patch) | |
| tree | 258690df4a5ab62055261579967d6dfffaf5b0fd /include/stc/clist.h | |
| parent | 9cd20ebfc4f1e10153ff814085499223265ef902 (diff) | |
| download | STC-modified-d57b9bb7666753c7cf7ab5a0da6d7d11f303c2af.tar.gz STC-modified-d57b9bb7666753c7cf7ab5a0da6d7d11f303c2af.zip | |
- Added **cbox** type: container of one element: similar to std::unique_ptr / Rust Box.
- Replaced example for **csptr** in docs.
- Added [**c_forpair**](docs/ccommon_api.md) macro: for-loop with "structural binding" as in c++.
- Deprecated *csptr_X_make()*. Renamed to *csptr_X_new()*. Corresponding **cbox** method is *cbox_X_new()*.
- Deprecated *c_default_fromraw(raw)*. Renamed to *c_default_clone(raw)*.
- Deprecated `i_key_csptr` / `i_val_csptr`. Use `i_key_ref` / `i_val_ref` when specifying containers with **csptr** or **cbox** elements.
- Deprecated `i_cnt`. Use `i_type` instead to define the full container type name.
- Bugfixes and docs updates.
Diffstat (limited to 'include/stc/clist.h')
| -rw-r--r-- | include/stc/clist.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h index bb090a62..7cd2df50 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -125,6 +125,7 @@ _cx_memb(_copy)(_cx_self *self, _cx_self other) { }
#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; }
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); }
|
