P-p-H-d / mlib

Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
BSD 2-Clause "Simplified" License
898 stars 77 forks source link

Add EMPLACE_TYPE support for B+TREE, DICT, RB-TREE, BUFFER, CONCURRENT #104

Closed P-p-H-d closed 2 years ago

P-p-H-d commented 2 years ago

Add basic & naive implementation of emplace* functions for:

P-p-H-d commented 2 years ago

Done for RB Tree

P-p-H-d commented 2 years ago

The main problem for the remaining emplace functions is to find how to name the emplace function:

name_emplace_suffix1b_on_suffix1a(container, value, key) may be natural english but the order of the arguments are different than name_set_at(container, key, value) and C++ emplace

See also https://cplusplus.com/reference/vector/vector/emplace/

P-p-H-d commented 2 years ago

I'll probably go on with "name_key_emplace_suffix1a_val_suffix1b" with suffix1a being the key and suffix1b the value even if it is not perfect.