summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cvec.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-06-20 15:28:02 +0200
committerTyge Løvset <[email protected]>2023-06-20 15:28:02 +0200
commitde4f8fa86f141dfeab15f5576029910474f56fa1 (patch)
tree930f8ecb0a2765d4834aa34f6ac538096454816c /include/stc/cvec.h
parentb617eded8cee98dd3ff9ac896328b172d37fcf91 (diff)
downloadSTC-modified-de4f8fa86f141dfeab15f5576029910474f56fa1.tar.gz
STC-modified-de4f8fa86f141dfeab15f5576029910474f56fa1.zip
Internal only:
Renamed _cx_memb() macro to _cx_MEMB() Renamed _cx_self macro to _cx_Self
Diffstat (limited to 'include/stc/cvec.h')
-rw-r--r--include/stc/cvec.h220
1 files changed, 110 insertions, 110 deletions
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index 71787733..3213dd1c 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -74,164 +74,164 @@ int main() {
#include "priv/template.h"
#ifndef i_is_forward
- _cx_deftypes(_c_cvec_types, _cx_self, i_key);
+ _cx_DEFTYPES(_c_cvec_types, _cx_Self, i_key);
#endif
typedef i_keyraw _cx_raw;
-STC_API _cx_self _cx_memb(_init)(void);
-STC_API void _cx_memb(_drop)(_cx_self* self);
-STC_API void _cx_memb(_clear)(_cx_self* self);
-STC_API bool _cx_memb(_reserve)(_cx_self* self, intptr_t cap);
-STC_API bool _cx_memb(_resize)(_cx_self* self, intptr_t size, i_key null);
-STC_API _cx_value* _cx_memb(_push)(_cx_self* self, i_key value);
-STC_API _cx_iter _cx_memb(_erase_n)(_cx_self* self, intptr_t idx, intptr_t n);
-STC_API _cx_iter _cx_memb(_insert_uninit)(_cx_self* self, intptr_t idx, intptr_t n);
+STC_API _cx_Self _cx_MEMB(_init)(void);
+STC_API void _cx_MEMB(_drop)(_cx_Self* self);
+STC_API void _cx_MEMB(_clear)(_cx_Self* self);
+STC_API bool _cx_MEMB(_reserve)(_cx_Self* self, intptr_t cap);
+STC_API bool _cx_MEMB(_resize)(_cx_Self* self, intptr_t size, i_key null);
+STC_API _cx_value* _cx_MEMB(_push)(_cx_Self* self, i_key value);
+STC_API _cx_iter _cx_MEMB(_erase_n)(_cx_Self* self, intptr_t idx, intptr_t n);
+STC_API _cx_iter _cx_MEMB(_insert_uninit)(_cx_Self* self, intptr_t idx, intptr_t n);
#if !defined i_no_cmp || defined _i_has_eq
-STC_API _cx_iter _cx_memb(_find_in)(_cx_iter it1, _cx_iter it2, _cx_raw raw);
+STC_API _cx_iter _cx_MEMB(_find_in)(_cx_iter it1, _cx_iter it2, _cx_raw raw);
#endif
#ifndef i_no_cmp
-STC_API int _cx_memb(_value_cmp)(const _cx_value* x, const _cx_value* y);
-STC_API _cx_iter _cx_memb(_binary_search_in)(_cx_iter it1, _cx_iter it2, _cx_raw raw, _cx_iter* lower_bound);
+STC_API int _cx_MEMB(_value_cmp)(const _cx_value* x, const _cx_value* y);
+STC_API _cx_iter _cx_MEMB(_binary_search_in)(_cx_iter it1, _cx_iter it2, _cx_raw raw, _cx_iter* lower_bound);
#endif
-STC_INLINE void _cx_memb(_value_drop)(_cx_value* val) { i_keydrop(val); }
+STC_INLINE void _cx_MEMB(_value_drop)(_cx_value* val) { i_keydrop(val); }
#if !defined i_no_emplace
STC_API _cx_iter
-_cx_memb(_emplace_n)(_cx_self* self, intptr_t idx, const _cx_raw raw[], intptr_t n);
+_cx_MEMB(_emplace_n)(_cx_Self* self, intptr_t idx, const _cx_raw raw[], intptr_t n);
-STC_INLINE _cx_value* _cx_memb(_emplace)(_cx_self* self, _cx_raw raw) {
- return _cx_memb(_push)(self, i_keyfrom(raw));
+STC_INLINE _cx_value* _cx_MEMB(_emplace)(_cx_Self* self, _cx_raw raw) {
+ return _cx_MEMB(_push)(self, i_keyfrom(raw));
}
-STC_INLINE _cx_value* _cx_memb(_emplace_back)(_cx_self* self, _cx_raw raw) {
- return _cx_memb(_push)(self, i_keyfrom(raw));
+STC_INLINE _cx_value* _cx_MEMB(_emplace_back)(_cx_Self* self, _cx_raw raw) {
+ return _cx_MEMB(_push)(self, i_keyfrom(raw));
}
-STC_INLINE _cx_iter _cx_memb(_emplace_at)(_cx_self* self, _cx_iter it, _cx_raw raw) {
- return _cx_memb(_emplace_n)(self, _it_ptr(it) - self->data, &raw, 1);
+STC_INLINE _cx_iter _cx_MEMB(_emplace_at)(_cx_Self* self, _cx_iter it, _cx_raw raw) {
+ return _cx_MEMB(_emplace_n)(self, _it_ptr(it) - self->data, &raw, 1);
}
#endif // !i_no_emplace
#if !defined i_no_clone
-STC_API _cx_self _cx_memb(_clone)(_cx_self cx);
-STC_API _cx_iter _cx_memb(_copy_n)(_cx_self* self, intptr_t idx, const _cx_value arr[], intptr_t n);
-STC_INLINE void _cx_memb(_put_n)(_cx_self* self, const _cx_raw* raw, intptr_t n)
- { while (n--) _cx_memb(_push)(self, i_keyfrom(*raw++)); }
-STC_INLINE _cx_self _cx_memb(_from_n)(const _cx_raw* raw, intptr_t n)
- { _cx_self cx = {0}; _cx_memb(_put_n)(&cx, raw, n); return cx; }
-STC_INLINE i_key _cx_memb(_value_clone)(_cx_value val)
+STC_API _cx_Self _cx_MEMB(_clone)(_cx_Self cx);
+STC_API _cx_iter _cx_MEMB(_copy_n)(_cx_Self* self, intptr_t idx, const _cx_value arr[], intptr_t n);
+STC_INLINE void _cx_MEMB(_put_n)(_cx_Self* self, const _cx_raw* raw, intptr_t n)
+ { while (n--) _cx_MEMB(_push)(self, i_keyfrom(*raw++)); }
+STC_INLINE _cx_Self _cx_MEMB(_from_n)(const _cx_raw* raw, intptr_t n)
+ { _cx_Self cx = {0}; _cx_MEMB(_put_n)(&cx, raw, n); return cx; }
+STC_INLINE i_key _cx_MEMB(_value_clone)(_cx_value val)
{ return i_keyclone(val); }
-STC_INLINE void _cx_memb(_copy)(_cx_self* self, const _cx_self* other) {
+STC_INLINE void _cx_MEMB(_copy)(_cx_Self* self, const _cx_Self* other) {
if (self->data == other->data) return;
- _cx_memb(_clear)(self);
- _cx_memb(_copy_n)(self, 0, other->data, other->_len);
+ _cx_MEMB(_clear)(self);
+ _cx_MEMB(_copy_n)(self, 0, other->data, other->_len);
}
#endif // !i_no_clone
-STC_INLINE intptr_t _cx_memb(_size)(const _cx_self* self) { return self->_len; }
-STC_INLINE intptr_t _cx_memb(_capacity)(const _cx_self* self) { return self->_cap; }
-STC_INLINE bool _cx_memb(_empty)(const _cx_self* self) { return !self->_len; }
-STC_INLINE _cx_raw _cx_memb(_value_toraw)(const _cx_value* val) { return i_keyto(val); }
-STC_INLINE _cx_value* _cx_memb(_front)(const _cx_self* self) { return self->data; }
-STC_INLINE _cx_value* _cx_memb(_back)(const _cx_self* self)
+STC_INLINE intptr_t _cx_MEMB(_size)(const _cx_Self* self) { return self->_len; }
+STC_INLINE intptr_t _cx_MEMB(_capacity)(const _cx_Self* self) { return self->_cap; }
+STC_INLINE bool _cx_MEMB(_empty)(const _cx_Self* self) { return !self->_len; }
+STC_INLINE _cx_raw _cx_MEMB(_value_toraw)(const _cx_value* val) { return i_keyto(val); }
+STC_INLINE _cx_value* _cx_MEMB(_front)(const _cx_Self* self) { return self->data; }
+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)
+STC_INLINE void _cx_MEMB(_pop)(_cx_Self* self)
{ assert(self->_len); _cx_value* p = &self->data[--self->_len]; i_keydrop(p); }
-STC_INLINE _cx_value _cx_memb(_pull)(_cx_self* self)
+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); }
-
-STC_INLINE _cx_self
-_cx_memb(_with_size)(const intptr_t size, i_key null) {
- _cx_self cx = _cx_memb(_init)();
- _cx_memb(_resize)(&cx, size, null);
+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); }
+
+STC_INLINE _cx_Self
+_cx_MEMB(_with_size)(const intptr_t size, i_key null) {
+ _cx_Self cx = _cx_MEMB(_init)();
+ _cx_MEMB(_resize)(&cx, size, null);
return cx;
}
-STC_INLINE _cx_self
-_cx_memb(_with_capacity)(const intptr_t cap) {
- _cx_self cx = _cx_memb(_init)();
- _cx_memb(_reserve)(&cx, cap);
+STC_INLINE _cx_Self
+_cx_MEMB(_with_capacity)(const intptr_t cap) {
+ _cx_Self cx = _cx_MEMB(_init)();
+ _cx_MEMB(_reserve)(&cx, cap);
return cx;
}
STC_INLINE void
-_cx_memb(_shrink_to_fit)(_cx_self* self) {
- _cx_memb(_reserve)(self, _cx_memb(_size)(self));
+_cx_MEMB(_shrink_to_fit)(_cx_Self* self) {
+ _cx_MEMB(_reserve)(self, _cx_MEMB(_size)(self));
}
STC_INLINE _cx_iter
-_cx_memb(_insert_n)(_cx_self* self, const intptr_t idx, const _cx_value arr[], const intptr_t n) {
- _cx_iter it = _cx_memb(_insert_uninit)(self, idx, n);
+_cx_MEMB(_insert_n)(_cx_Self* self, const intptr_t idx, const _cx_value arr[], const intptr_t n) {
+ _cx_iter it = _cx_MEMB(_insert_uninit)(self, idx, n);
if (it.ref)
c_memcpy(it.ref, arr, n*c_sizeof *arr);
return it;
}
STC_INLINE _cx_iter
-_cx_memb(_insert)(_cx_self* self, const intptr_t idx, const i_key value) {
- return _cx_memb(_insert_n)(self, idx, &value, 1);
+_cx_MEMB(_insert)(_cx_Self* self, const intptr_t idx, const i_key value) {
+ return _cx_MEMB(_insert_n)(self, idx, &value, 1);
}
STC_INLINE _cx_iter
-_cx_memb(_insert_at)(_cx_self* self, _cx_iter it, const i_key value) {
- return _cx_memb(_insert_n)(self, _it_ptr(it) - self->data, &value, 1);
+_cx_MEMB(_insert_at)(_cx_Self* self, _cx_iter it, const i_key value) {
+ return _cx_MEMB(_insert_n)(self, _it_ptr(it) - self->data, &value, 1);
}
STC_INLINE _cx_iter
-_cx_memb(_erase_at)(_cx_self* self, _cx_iter it) {
- return _cx_memb(_erase_n)(self, it.ref - self->data, 1);
+_cx_MEMB(_erase_at)(_cx_Self* self, _cx_iter it) {
+ return _cx_MEMB(_erase_n)(self, it.ref - self->data, 1);
}
STC_INLINE _cx_iter
-_cx_memb(_erase_range)(_cx_self* self, _cx_iter i1, _cx_iter i2) {
- return _cx_memb(_erase_n)(self, i1.ref - self->data, _it2_ptr(i1, i2) - i1.ref);
+_cx_MEMB(_erase_range)(_cx_Self* self, _cx_iter i1, _cx_iter i2) {
+ return _cx_MEMB(_erase_n)(self, i1.ref - self->data, _it2_ptr(i1, i2) - i1.ref);
}
STC_INLINE const _cx_value*
-_cx_memb(_at)(const _cx_self* self, const intptr_t idx) {
+_cx_MEMB(_at)(const _cx_Self* self, const intptr_t idx) {
assert(idx < self->_len); return self->data + idx;
}
STC_INLINE _cx_value*
-_cx_memb(_at_mut)(_cx_self* self, const intptr_t idx) {
+_cx_MEMB(_at_mut)(_cx_Self* self, const intptr_t idx) {
assert(idx < self->_len); return self->data + idx;
}
-STC_INLINE _cx_iter _cx_memb(_begin)(const _cx_self* self) {
+STC_INLINE _cx_iter _cx_MEMB(_begin)(const _cx_Self* self) {
intptr_t n = self->_len;
return c_LITERAL(_cx_iter){n ? self->data : NULL, self->data + n};
}
-STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
+STC_INLINE _cx_iter _cx_MEMB(_end)(const _cx_Self* self)
{ return c_LITERAL(_cx_iter){NULL, self->data + self->_len}; }
-STC_INLINE void _cx_memb(_next)(_cx_iter* it)
+STC_INLINE void _cx_MEMB(_next)(_cx_iter* it)
{ if (++it->ref == it->end) it->ref = NULL; }
-STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t n)
+STC_INLINE _cx_iter _cx_MEMB(_advance)(_cx_iter it, size_t n)
{ if ((it.ref += n) >= it.end) it.ref = NULL; return it; }
-STC_INLINE intptr_t _cx_memb(_index)(const _cx_self* self, _cx_iter it)
+STC_INLINE intptr_t _cx_MEMB(_index)(const _cx_Self* self, _cx_iter it)
{ return (it.ref - self->data); }
-STC_INLINE void _cx_memb(_adjust_end_)(_cx_self* self, intptr_t n)
+STC_INLINE void _cx_MEMB(_adjust_end_)(_cx_Self* self, intptr_t n)
{ self->_len += n; }
#if !defined i_no_cmp || defined _i_has_eq
STC_INLINE _cx_iter
-_cx_memb(_find)(const _cx_self* self, _cx_raw raw) {
- return _cx_memb(_find_in)(_cx_memb(_begin)(self), _cx_memb(_end)(self), raw);
+_cx_MEMB(_find)(const _cx_Self* self, _cx_raw raw) {
+ return _cx_MEMB(_find_in)(_cx_MEMB(_begin)(self), _cx_MEMB(_end)(self), raw);
}
STC_INLINE const _cx_value*
-_cx_memb(_get)(const _cx_self* self, _cx_raw raw) {
- return _cx_memb(_find)(self, raw).ref;
+_cx_MEMB(_get)(const _cx_Self* self, _cx_raw raw) {
+ return _cx_MEMB(_find)(self, raw).ref;
}
STC_INLINE _cx_value*
-_cx_memb(_get_mut)(const _cx_self* self, _cx_raw raw)
- { return (_cx_value*) _cx_memb(_get)(self, raw); }
+_cx_MEMB(_get_mut)(const _cx_Self* self, _cx_raw raw)
+ { return (_cx_value*) _cx_MEMB(_get)(self, raw); }
STC_INLINE bool
-_cx_memb(_eq)(const _cx_self* self, const _cx_self* other) {
+_cx_MEMB(_eq)(const _cx_Self* self, const _cx_Self* other) {
if (self->_len != other->_len) return false;
for (intptr_t i = 0; i < self->_len; ++i) {
const _cx_raw _rx = i_keyto(self->data+i), _ry = i_keyto(other->data+i);
@@ -243,39 +243,39 @@ _cx_memb(_eq)(const _cx_self* self, const _cx_self* other) {
#ifndef i_no_cmp
STC_INLINE _cx_iter
-_cx_memb(_binary_search)(const _cx_self* self, _cx_raw raw) {
+_cx_MEMB(_binary_search)(const _cx_Self* self, _cx_raw raw) {
_cx_iter lower;
- return _cx_memb(_binary_search_in)(_cx_memb(_begin)(self), _cx_memb(_end)(self), raw, &lower);
+ return _cx_MEMB(_binary_search_in)(_cx_MEMB(_begin)(self), _cx_MEMB(_end)(self), raw, &lower);
}
STC_INLINE _cx_iter
-_cx_memb(_lower_bound)(const _cx_self* self, _cx_raw raw) {
+_cx_MEMB(_lower_bound)(const _cx_Self* self, _cx_raw raw) {
_cx_iter lower;
- _cx_memb(_binary_search_in)(_cx_memb(_begin)(self), _cx_memb(_end)(self), raw, &lower);
+ _cx_MEMB(_binary_search_in)(_cx_MEMB(_begin)(self), _cx_MEMB(_end)(self), raw, &lower);
return lower;
}
STC_INLINE void
-_cx_memb(_sort_range)(_cx_iter i1, _cx_iter i2, int(*cmp)(const _cx_value*, const _cx_value*)) {
+_cx_MEMB(_sort_range)(_cx_iter i1, _cx_iter i2, int(*cmp)(const _cx_value*, const _cx_value*)) {
qsort(i1.ref, (size_t)(_it2_ptr(i1, i2) - i1.ref), sizeof(_cx_value),
(int(*)(const void*, const void*)) cmp);
}
STC_INLINE void
-_cx_memb(_sort)(_cx_self* self) {
- _cx_memb(_sort_range)(_cx_memb(_begin)(self), _cx_memb(_end)(self), _cx_memb(_value_cmp));
+_cx_MEMB(_sort)(_cx_Self* self) {
+ _cx_MEMB(_sort_range)(_cx_MEMB(_begin)(self), _cx_MEMB(_end)(self), _cx_MEMB(_value_cmp));
}
#endif // !c_no_cmp
/* -------------------------- IMPLEMENTATION ------------------------- */
#if defined(i_implement) || defined(i_static)
-STC_DEF _cx_self
-_cx_memb(_init)(void) {
- return c_LITERAL(_cx_self){NULL};
+STC_DEF _cx_Self
+_cx_MEMB(_init)(void) {
+ return c_LITERAL(_cx_Self){NULL};
}
STC_DEF void
-_cx_memb(_clear)(_cx_self* self) {
+_cx_MEMB(_clear)(_cx_Self* self) {
if (self->_cap) {
for (_cx_value *p = self->data, *q = p + self->_len; p != q; ) {
--q; i_keydrop(q);
@@ -285,15 +285,15 @@ _cx_memb(_clear)(_cx_self* self) {
}
STC_DEF void
-_cx_memb(_drop)(_cx_self* self) {
+_cx_MEMB(_drop)(_cx_Self* self) {
if (self->_cap == 0)
return;
- _cx_memb(_clear)(self);
+ _cx_MEMB(_clear)(self);
i_free(self->data);
}
STC_DEF bool
-_cx_memb(_reserve)(_cx_self* self, const intptr_t cap) {
+_cx_MEMB(_reserve)(_cx_Self* self, const intptr_t cap) {
if (cap > self->_cap || (cap && cap == self->_len)) {
_cx_value* d = (_cx_value*)i_realloc(self->data, cap*c_sizeof(i_key));
if (!d)
@@ -305,8 +305,8 @@ _cx_memb(_reserve)(_cx_self* self, const intptr_t cap) {
}
STC_DEF bool
-_cx_memb(_resize)(_cx_self* self, const intptr_t len, i_key null) {
- if (!_cx_memb(_reserve)(self, len))
+_cx_MEMB(_resize)(_cx_Self* self, const intptr_t len, i_key null) {
+ if (!_cx_MEMB(_reserve)(self, len))
return false;
const intptr_t n = self->_len;
for (intptr_t i = len; i < n; ++i)
@@ -318,9 +318,9 @@ _cx_memb(_resize)(_cx_self* self, const intptr_t len, i_key null) {
}
STC_DEF _cx_value*
-_cx_memb(_push)(_cx_self* self, i_key value) {
+_cx_MEMB(_push)(_cx_Self* self, i_key value) {
if (self->_len == self->_cap)
- if (!_cx_memb(_reserve)(self, self->_len*3/2 + 4))
+ if (!_cx_MEMB(_reserve)(self, self->_len*3/2 + 4))
return NULL;
_cx_value *v = self->data + self->_len++;
*v = value;
@@ -328,10 +328,10 @@ _cx_memb(_push)(_cx_self* self, i_key value) {
}
STC_DEF _cx_iter
-_cx_memb(_insert_uninit)(_cx_self* self, const intptr_t idx, const intptr_t n) {
+_cx_MEMB(_insert_uninit)(_cx_Self* self, const intptr_t idx, const intptr_t n) {
if (self->_len + n > self->_cap)
- if (!_cx_memb(_reserve)(self, self->_len*3/2 + n))
- return _cx_memb(_end)(self);
+ if (!_cx_MEMB(_reserve)(self, self->_len*3/2 + n))
+ return _cx_MEMB(_end)(self);
_cx_value* pos = self->data + idx;
c_memmove(pos + n, pos, (self->_len - idx)*c_sizeof *pos);
@@ -340,7 +340,7 @@ _cx_memb(_insert_uninit)(_cx_self* self, const intptr_t idx, const intptr_t n) {
}
STC_DEF _cx_iter
-_cx_memb(_erase_n)(_cx_self* self, const intptr_t idx, const intptr_t len) {
+_cx_MEMB(_erase_n)(_cx_Self* self, const intptr_t idx, const intptr_t len) {
_cx_value* d = self->data + idx, *p = d, *end = self->data + self->_len;
for (intptr_t i = 0; i < len; ++i, ++p)
{ i_keydrop(p); }
@@ -350,17 +350,17 @@ _cx_memb(_erase_n)(_cx_self* self, const intptr_t idx, const intptr_t len) {
}
#if !defined i_no_clone
-STC_DEF _cx_self
-_cx_memb(_clone)(_cx_self cx) {
- _cx_self out = _cx_memb(_init)();
- _cx_memb(_copy_n)(&out, 0, cx.data, cx._len);
+STC_DEF _cx_Self
+_cx_MEMB(_clone)(_cx_Self cx) {
+ _cx_Self out = _cx_MEMB(_init)();
+ _cx_MEMB(_copy_n)(&out, 0, cx.data, cx._len);
return out;
}
STC_DEF _cx_iter
-_cx_memb(_copy_n)(_cx_self* self, const intptr_t idx,
+_cx_MEMB(_copy_n)(_cx_Self* self, const intptr_t idx,
const _cx_value arr[], const intptr_t n) {
- _cx_iter it = _cx_memb(_insert_uninit)(self, idx, n);
+ _cx_iter it = _cx_MEMB(_insert_uninit)(self, idx, n);
if (it.ref)
for (_cx_value* p = it.ref, *q = p + n; p != q; ++arr)
*p++ = i_keyclone((*arr));
@@ -370,8 +370,8 @@ _cx_memb(_copy_n)(_cx_self* self, const intptr_t idx,
#if !defined i_no_emplace
STC_DEF _cx_iter
-_cx_memb(_emplace_n)(_cx_self* self, const intptr_t idx, const _cx_raw raw[], intptr_t n) {
- _cx_iter it = _cx_memb(_insert_uninit)(self, idx, n);
+_cx_MEMB(_emplace_n)(_cx_Self* self, const intptr_t idx, const _cx_raw raw[], intptr_t n) {
+ _cx_iter it = _cx_MEMB(_insert_uninit)(self, idx, n);
if (it.ref)
for (_cx_value* p = it.ref; n--; ++raw, ++p)
*p = i_keyfrom((*raw));
@@ -381,7 +381,7 @@ _cx_memb(_emplace_n)(_cx_self* self, const intptr_t idx, const _cx_raw raw[], in
#if !defined i_no_cmp || defined _i_has_eq
STC_DEF _cx_iter
-_cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
+_cx_MEMB(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
const _cx_value* p2 = _it2_ptr(i1, i2);
for (; i1.ref != p2; ++i1.ref) {
const _cx_raw r = i_keyto(i1.ref);
@@ -395,7 +395,7 @@ _cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
#ifndef i_no_cmp
STC_DEF _cx_iter
-_cx_memb(_binary_search_in)(_cx_iter i1, _cx_iter i2, const _cx_raw raw,
+_cx_MEMB(_binary_search_in)(_cx_iter i1, _cx_iter i2, const _cx_raw raw,
_cx_iter* lower_bound) {
_cx_value* w[2] = {i1.ref, _it2_ptr(i1, i2)};
_cx_iter mid = i1;
@@ -412,7 +412,7 @@ _cx_memb(_binary_search_in)(_cx_iter i1, _cx_iter i2, const _cx_raw raw,
i1.ref = NULL; return i1;
}
-STC_DEF int _cx_memb(_value_cmp)(const _cx_value* x, const _cx_value* y) {
+STC_DEF int _cx_MEMB(_value_cmp)(const _cx_value* x, const _cx_value* y) {
const _cx_raw rx = i_keyto(x);
const _cx_raw ry = i_keyto(y);
return i_cmp((&rx), (&ry));