diff -r 9a10af83cfab -r dc886f1a6155 docs/Writerside/topics/list.h.md --- a/docs/Writerside/topics/list.h.md Sat Nov 01 19:31:48 2025 +0100 +++ b/docs/Writerside/topics/list.h.md Sat Nov 01 19:48:50 2025 +0100 @@ -374,6 +374,12 @@ cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); + +int cxListIntersection(CxList *dst, + const CxList *src, const CxList *other, + cx_clone_func clone_func, + const CxAllocator *clone_allocator, + void *data); ``` With `cxListClone()` you can create deep copies of the elements in a list and insert them into another list. @@ -382,8 +388,9 @@ to insert anything. The function `cxListDifference()` is similar to `cxListClone()`, -except that it only clones elements from the minuend that are _not_ contained in the subtrahend. -It is optimized for sorted lists, in which case it will take linear time instead of quadratic time for the operation. +except that it only clones elements from the minuend that are _not_ contained in the subtrahend, +while `cxListIntersection()` only clones elements that _are_ contained in both lists. +Both functions are optimized for sorted lists, in which case they will take linear time instead of quadratic time for the operation. Refer to the documentation of the [clone-function callback](allocator.h.md#clone-function) to learn how to implement it.