# Idea: Testing Set Inclusion

**URL:** <https://forums.swift.org/t/idea-testing-set-inclusion/73613>\
**Category:** Algorithms\
**Tags:** sorting, sequence, swift-algorithms\
**Created:** [August 1, 2024, 3:09am UTC](https://forums.swift.org/t/idea-testing-set-inclusion/73613 "2024-08-01T03:09:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CTMacUser](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ctmacuser/32/1802_2.png) [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Post date:** [August 1, 2024, 3:09am UTC](https://forums.swift.org/t/idea-testing-set-inclusion/73613/1 "2024-08-01T03:09:39Z")

</div>

I made a new implementation of testing if one sorted sequence is contained within another. (The tested elements need not be contiguous in the receiver.) It's an analog of the C++ `std::includes` function.

- [The current code](https://github.com/apple/swift-algorithms/pull/234)
- [Discussion of a previous try](https://forums.swift.org/t/sorted-sequence-operations-merge-sort-set-operations-inclusion-testing/31145)
