diff --git a/doc/API.txt b/doc/API.txt index bc70e054..38bb5961 100644 --- a/doc/API.txt +++ b/doc/API.txt @@ -54,4 +54,4 @@ V0.4.*: * The order of a list initialized using M_LET is reversed * Method _init_set2 of m-i-shared is marked as deprecated. * Operator _it_insert now updates it_insertion iterator to reference the inserted element. * Dereference Type of an iterator of a dict / B+Tree is suffixed now _itref_t instead of _type_t. - \ No newline at end of file + * Rename TUPLE _init_set2 in _init_emplace & _set2 in _emplace diff --git a/m-dict.h b/m-dict.h index 9ebe318e..e4beb773 100644 --- a/m-dict.h +++ b/m-dict.h @@ -567,7 +567,7 @@ return; \ } \ } \ - M_C(name, _pair_init_set2)(*M_C(name, _list_pair_push_raw)(*list_ptr), \ + M_C(name, _pair_init_emplace)(*M_C(name, _list_pair_push_raw)(*list_ptr), \ M_IF(isStoreHash)(hash M_DEFERRED_COMMA,) \ key \ M_IF(isSet)(, M_DEFERRED_COMMA value)); \ diff --git a/m-tuple.h b/m-tuple.h index 12a7a92c..29539a04 100644 --- a/m-tuple.h +++ b/m-tuple.h @@ -252,9 +252,8 @@ namespace m_tuple { TUPLEI_CALL_INIT_SET(a, my -> TUPLEI_GET_FIELD a , org -> TUPLEI_GET_FIELD a ); /* Define the INIT_WITH method calling the INIT_SET method for all params. */ -/* FIXME: To rename? */ #define TUPLEI_DEFINE_INIT_SET2(name, ...) \ - static inline void M_C(name, _init_set2)(M_C(name,_ct) my \ + static inline void M_C(name, _init_emplace)(M_C(name,_ct) my \ M_MAP(TUPLEI_DEFINE_INIT_SET2_PROTO, __VA_ARGS__) \ ) { \ M_MAP(TUPLEI_DEFINE_INIT_SET2_FUNC , __VA_ARGS__) \ @@ -281,9 +280,8 @@ namespace m_tuple { /* Define the SET_WITH method calling the SET method for all params. */ -/* FIXME: To rename? */ #define TUPLEI_DEFINE_SET2(name, ...) \ - static inline void M_C(name, _set2)(M_C(name,_ct) my \ + static inline void M_C(name, _emplace)(M_C(name,_ct) my \ M_MAP(TUPLEI_DEFINE_SET2_PROTO, __VA_ARGS__) \ ) { \ TUPLEI_CONTRACT(my); \ @@ -654,7 +652,7 @@ namespace m_tuple { #define TUPLEI_OPLIST_P3(name, ...) \ (M_IF_METHOD_ALL(INIT, __VA_ARGS__)(INIT(M_C(name,_init)),), \ INIT_SET(M_C(name, _init_set)), \ - INIT_WITH(M_C(name, _init_set2)), \ + INIT_WITH(M_C(name, _init_emplace)), \ SET(M_C(name,_set)), \ CLEAR(M_C(name, _clear)), \ TYPE(M_C(name,_ct)), \ diff --git a/tests/test-mtuple.c b/tests/test-mtuple.c index 05a649ec..2c4716b4 100644 --- a/tests/test-mtuple.c +++ b/tests/test-mtuple.c @@ -173,11 +173,11 @@ static void test1(void) pair3_t p3, p4; string_init_set_str(s, "HELLO"); testobj_init_set_ui (z, 1442); - pair3_init_set2(p3, s, z); - pair3_init_set2(p4, s, z); + pair3_init_emplace(p3, s, z); + pair3_init_emplace(p4, s, z); int i = pair3_cmp (p3, p4); assert (i == 0); - pair3_set2(p4, s, z); + pair3_emplace(p4, s, z); i = pair3_cmp (p3, p4); assert (i == 0); testobj_set_ui (z, 1443);