Add emplace generation for RB Tree

This commit is contained in:
Patrick Pelissier committed 2022-04-23 09:19:42 +02:00
1 parent 6a1ff3e080
commit 0c1e888a78
1 file changed
+19 -1
+19 -1
View File
@@ -1164,7 +1164,25 @@ typedef enum {
} \
, /* no in_serial */ ) \
\
\
M_EMPLACE_QUEUE_DEF(name, tree_t, M_C(name, _emplace), oplist, M_RBTR33_EMPLACE_DEF)
/* Definition of the emplace_back function for RB TREE
Nothing particular to note: we go through the slow path.
*/
#define M_RBTR33_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; \
/* Need to construct the object BEFORE, \
so that we can perform comparison on it when inserting it */ \
M_EMPLACE_CALL_FUNC(a, init_func, oplist, data, exp_emplace_type); \
M_C(name, _push)(v, data); \
M_CALL_CLEAR(oplist, data); \
}
// TODO: specialized _sort shall do nothing, but shall check the requested order. How ?
#if M_USE_SMALL_NAME