diff --git a/m-rbtree.h b/m-rbtree.h index e15d3051..1029aa7a 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -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