@@ -806,14 +806,15 @@ Example:
806
806
INIT_SET(mpz_init_set),CLEAR(mpz_clear), INIT_MOVE(M_COPY_A1_DEFAULT),TYPE(mpz_t))
807
807
```
808
808
809
- This can simplify a lot `OPLIST` usage and it is recommended.
809
+ > [!NOTE]
810
+ > Registering globaly the oplist when defining its type simplify a lot the `OPLIST` usage and it is **highly** recommended.
810
811
811
812
Then each times a macro expects an oplist, you can give instead its type.
812
813
This make the code much easier to read and understand.
813
814
814
815
There is one exception however: the macros that are used to build oplist
815
816
(like `ARRAY_OPLIST`) don't perform this simplification and the oplist of
816
- the basic type shall be given instead
817
+ the type shall be explictely given instead
817
818
(This is due to limitation in the C preprocessing).
818
819
819
820
### API Interface Adaptation
@@ -2453,6 +2454,13 @@ Both oplist shall have at least the following operators (`INIT_SET`, `SET` and `
2453
2454
otherwise it won't generate compilable code.
2454
2455
The `key_oplist` shall also define the additional operators (`HASH` and `EQUAL`).
2455
2456
2457
+ > [!NOTE]
2458
+ > You can either call this macro with only `key_type` and `value_type`
2459
+ > or with their type+oplists `key_type`, `key_oplist`, `value_type` and `value_oplist`.
2460
+ > You cannot call it with an oplist for a type and not for the other
2461
+ > (Otheriwse it won't be able to identify reliabely what is the third argument - a `value_type` or a `key_oplist` ?)
2462
+ > Failure to respect this rule so will result in a too few argument error for `M_D1CT_DEF2_P2` internal macro.
2463
+
2456
2464
Elements in the dictionary are **unordered**.
2457
2465
On insertion of a new element, contained objects may moved.
2458
2466
Maximum number of elements of this dictionary is 3'006'477'107 elements.
@@ -2520,6 +2528,13 @@ The elements may move when inserting / deleting other elements (and not just the
2520
2528
This implementation is in general faster for small types of keys
2521
2529
(like integer or float) but are slower for larger types.
2522
2530
2531
+ > [ !NOTE]
2532
+ > You can either call this macro with only ` key_type ` and ` value_type `
2533
+ > or with their type+oplists ` key_type ` , ` key_oplist ` , ` value_type ` and ` value_oplist ` .
2534
+ > You cannot call it with an oplist for a type and not for the other
2535
+ > (Otheriwse it won't be able to identify reliabely what is the third argument - a ` value_type ` or a ` key_oplist ` ?)
2536
+ > Failure to respect this rule so will result in a too few argument error for ` M_D1CT_DEF2_P2 ` internal macro.
2537
+
2523
2538
` DICT_OA_DEF2_AS ` is the same as ` DICT_OA_DEF2 `
2524
2539
except the name of the types ` name_t ` , ` name_it_t ` , ` name_itref_t ` are provided.
2525
2540
0 commit comments