diff -r bba2e5efdca0 -r ac1baaed2fd7 docs/Writerside/topics/list.h.md --- a/docs/Writerside/topics/list.h.md Fri Nov 07 19:23:21 2025 +0100 +++ b/docs/Writerside/topics/list.h.md Sat Nov 08 23:45:19 2025 +0100 @@ -369,23 +369,34 @@ const CxAllocator *clone_allocator, void *data); +int cxListCloneSimple(CxList *dst, const CxList *src); + int cxListDifference(CxList *dst, const CxList *minuend, const CxList *subtrahend, cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); - + +int cxListDifferenceSimple(CxList *dst, + const CxList *minuend, const CxList *subtrahend); + int cxListIntersection(CxList *dst, const CxList *src, const CxList *other, cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); - + +int cxListIntersectionSimple(CxList *dst, + const CxList *src, const CxList *other); + int cxListUnion(CxList *dst, const CxList *src, const CxList *other, cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); + +int cxListUnionSimple(CxList *dst, + const CxList *src, const CxList *other); ``` With `cxListClone()` you can create deep copies of the elements in a list and insert them into another list. @@ -407,6 +418,10 @@ Refer to the documentation of the [clone-function callback](allocator.h.md#clone-function) to learn how to implement it. +The _simple_ versions of the above functions use an internal shallow clone function +which uses `memcpy()` to copy the elements. +If the destination map is storing pointers, this internal clone function uses the current default allocator to allocate the memory. + The functions return zero if and only if all clone operations were successful. > It is perfectly possible to clone items into a list of a different type.