diff --git a/m-array.h b/m-array.h index 19d8f7da..96e031e3 100644 --- a/m-array.h +++ b/m-array.h @@ -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