Skip to content

Commit a9dc2ee

Browse files
committed
Update doc
1 parent 39a0a4f commit a9dc2ee

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,14 +806,15 @@ Example:
806806
INIT_SET(mpz_init_set),CLEAR(mpz_clear), INIT_MOVE(M_COPY_A1_DEFAULT),TYPE(mpz_t))
807807
```
808808
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.
810811
811812
Then each times a macro expects an oplist, you can give instead its type.
812813
This make the code much easier to read and understand.
813814
814815
There is one exception however: the macros that are used to build oplist
815816
(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
817818
(This is due to limitation in the C preprocessing).
818819
819820
### API Interface Adaptation
@@ -2453,6 +2454,13 @@ Both oplist shall have at least the following operators (`INIT_SET`, `SET` and `
24532454
otherwise it won't generate compilable code.
24542455
The `key_oplist` shall also define the additional operators (`HASH` and `EQUAL`).
24552456
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+
24562464
Elements in the dictionary are **unordered**.
24572465
On insertion of a new element, contained objects may moved.
24582466
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
25202528
This implementation is in general faster for small types of keys
25212529
(like integer or float) but are slower for larger types.
25222530

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+
25232538
`DICT_OA_DEF2_AS` is the same as `DICT_OA_DEF2`
25242539
except the name of the types `name_t`, `name_it_t`, `name_itref_t` are provided.
25252540

0 commit comments

Comments
 (0)