diff options
| author | Tyge Lovset <[email protected]> | 2023-03-31 22:08:07 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-03-31 22:08:07 +0200 |
| commit | 5693ae9ae0d1a18627ba540e0240da010b282296 (patch) | |
| tree | ccb0dbe519d9a27fc944446ecc1a574cd9d86fcc /include/stc/clist.h | |
| parent | 56c394ede691143a32d53f4094df37dc49dc0a29 (diff) | |
| download | STC-modified-5693ae9ae0d1a18627ba540e0240da010b282296.tar.gz STC-modified-5693ae9ae0d1a18627ba540e0240da010b282296.zip | |
Added stc/extend.h: A generalized way to type-safely extend a container with new members which can be accessed from the template parameters. See examples/functor.c
Diffstat (limited to 'include/stc/clist.h')
| -rw-r--r-- | include/stc/clist.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h index fa26fd65..ca02ae3c 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -82,7 +82,7 @@ #endif #include "priv/template.h" -#if !c_option(c_is_forward) +#ifndef i_is_forward _cx_deftypes(_c_clist_types, _cx_self, i_key); #endif _cx_deftypes(_c_clist_complete_types, _cx_self, dummy); @@ -204,8 +204,8 @@ _cx_memb(_get_mut)(_cx_self* self, _cx_raw val) { return _cx_memb(_find_in)(_cx_memb(_begin)(self), _cx_memb(_end)(self), val).ref; } -STC_INLINE bool _cx_memb(_eq)(const _cx_self* x, const _cx_self* y) { - _cx_iter i = _cx_memb(_begin)(x), j = _cx_memb(_begin)(y); +STC_INLINE bool _cx_memb(_eq)(const _cx_self* self, const _cx_self* other) { + _cx_iter i = _cx_memb(_begin)(self), j = _cx_memb(_begin)(other); for (; i.ref && j.ref; _cx_memb(_next)(&i), _cx_memb(_next)(&j)) { const _cx_raw _rx = i_keyto(i.ref), _ry = i_keyto(j.ref); if (!(i_eq((&_rx), (&_ry)))) return false; |
