Rename tuple function :

* _init_set2 in _init_emplace
* _set2 in _emplace
due to better & clearer naming.
(API break)
This commit is contained in:
Patrick Pelissier committed 2020-12-05 12:29:20 +01:00
1 parent 4d0e799c7a
commit 26eb882a30
4 files changed
+8 -10

No files matched your search

+1 -1
View File
@@ -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.
* Rename TUPLE _init_set2 in _init_emplace & _set2 in _emplace
+1 -1
View File
@@ -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)); \
+3 -5
View File
@@ -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)), \
+3 -3
View File
@@ -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);