Add generation of emplace functions

This commit is contained in:
Patrick Pelissier committed 2022-04-20 22:43:12 +02:00
1 parent 3a53044198
commit d85955ef60
1 file changed
+14
+14
View File
@@ -1093,6 +1093,20 @@
/* a1 has been expanded with the items of a2 */ \
a1->size = newSize; \
} \
} \
\
M_EMPLACE_QUEUE_DEF(name, array_t, M_C(name, _emplace_back), oplist, M_ARRA4_EMPLACE_DEF)
/* Definition of the emplace_back function for arrays */
#define M_ARRA4_EMPLACE_DEF(name, name_t, function_name, oplist, init_func, exp_emplace_type) \
static inline void \
function_name(name_t v \
M_EMPLACE_LIST_TYPE_VAR(a, exp_emplace_type) ) \
{ \
M_C(name, _subtype_ct) *data = M_C(name, _push_raw)(v); \
if (M_UNLIKELY (data == NULL) ) \
return; \
M_EMPLACE_CALL_FUNC(a, init_func, oplist, *data, exp_emplace_type); \
} \
#if M_USE_SMALL_NAME