Sun, 17 Aug 2025 23:10:25 +0200
fix the documentation regarding member function that now support emplace-mechanics
docs/Writerside/topics/list.h.md | file | annotate | diff | comparison | revisions | |
docs/Writerside/topics/map.h.md | file | annotate | diff | comparison | revisions |
--- a/docs/Writerside/topics/list.h.md Sun Aug 17 23:05:16 2025 +0200 +++ b/docs/Writerside/topics/list.h.md Sun Aug 17 23:10:25 2025 +0200 @@ -414,7 +414,7 @@ |------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `clear` | Invoke destructor functions on all elements and remove them from the list. | | `deallocate` | Invoke destructor functions on all elements and deallocate the entire list memory. | -| `insert_element` | Insert a single element at the specified index. Return a pointer to the data of the inserted element or `NULL` on failure. | +| `insert_element` | Insert a single element at the specified index. Return a pointer to the allocated element or `NULL` on failure. | | `insert_array` | Insert an array of elements starting at the specified index. Return the number of elements inserted. | | `insert_sorted` | Insert an array of sorted elements into a sorted list. Return the number of elements inserted. | | `insert_iter` | Insert a single element depending on the iterator position. The third argument to this function is zero when the element shall be inserted after the iterator position and non-zero if it shall be inserted before the iterator position. The implementation is also responsible for adjusting the iterator, respectively. |
--- a/docs/Writerside/topics/map.h.md Sun Aug 17 23:05:16 2025 +0200 +++ b/docs/Writerside/topics/map.h.md Sun Aug 17 23:10:25 2025 +0200 @@ -356,14 +356,14 @@ The required behavior for the implementations is described in the following table. You can always look at the source code of the UCX hash map to get inspiration. -| Function | Description | -|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `clear` | Invoke [destructor functions](collection.h.md#destructor-functions) on all elements and remove them from the map. | -| `deallocate` | Invoke destructor functions on all elements and deallocate the entire map memory. | -| `put` | Store an element in the map. If an element is already stored, invoke the destructor functions on that element and replace it with the new element. Return non-zero when allocating memory fails. | -| `get` | Look up the specified key and return the associated value (or `NULL` if the key was not found). | -| `remove` | Remove an element from the map. If a target buffer is specified, copy the elements to that buffer. Otherwise, invoke the destructor functions for the element. If the key was not found in the map, return non-zero. | -| `iterator` | Return an iterator over the pairs, the keys, or the values, depending on the iterator type passed with the last argument. | +| Function | Description | +|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `clear` | Invoke [destructor functions](collection.h.md#destructor-functions) on all elements and remove them from the map. | +| `deallocate` | Invoke destructor functions on all elements and deallocate the entire map memory. | +| `put` | Store an element in the map. If an element is already stored, invoke the destructor functions on that element and replace it with the new element. When the value pointer is `NULL`, only allocate memory without copying an existing value. Return a pointer to the allocated memory, or `NULL` when allocation fails. | +| `get` | Look up the specified key and return the associated value (or `NULL` if the key was not found). | +| `remove` | Remove an element from the map. If a target buffer is specified, copy the elements to that buffer. Otherwise, invoke the destructor functions for the element. If the key was not found in the map, return non-zero. | +| `iterator` | Return an iterator over the pairs, the keys, or the values, depending on the iterator type passed with the last argument. | > In contrast to the list interface, there is no `cx_map_init()` function which automatically > configures a wrapping mechanism when `CX_STORE_POINTERS` is used.