SET_ALGORITHMS(3)
π NAME
Set Operation Algorithms(3) β Library Functions Manual
okay so bestie, this is the manual page for the set-operation algorithm girlies. The title is Set Operation Algorithms(3) and the manual name is Library Functions Manual β iconic, no cap. π
β¨ Functions
here's the full roster, and yes, every overload is invited to the function party β no skipping, no merging, no editing. π«Ά
πΈ std::includes
- with
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _Compare > bool std::includes (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
- without
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 > bool std::includes (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
π¦ std::set_difference
- with
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
- without
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
π std::set_intersection
- with
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_intersection (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
- without
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_intersection (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
π std::set_symmetric_difference
- with
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_symmetric_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
- without
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_symmetric_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
π₯ std::set_union
- with
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_union (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
- without
_Compare:
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_union (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
π Detailed Description
okay so the whole vibe is this: these algorithms are common set operations performed on sequences that are already sorted. read that again, bestie β already sorted β that's the setup. the number of comparisons will be linear, fr fr. that's the spec, and it's giving exactly what it needs to give. π
π« FUNCTION DOCUMENTATION π«
okay bestie, buckle up β this is the part where every single function gets its moment π
πΈ std::includes (the one with _Compare) πΈ
template<typename _InputIterator1 , typename _InputIterator2 , typename _Compare > bool std::includes (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) [inline]
Determines whether all elements of a sequence exists in a range using comparison. yes that's the whole vibe check π«Ά
Parameters:
first1β Start of search range.last1β End of search range.first2β Start of sequencelast2β End of sequence.compβ Comparison function to use.
Returns:
True if each element in [first2,last2) is contained in order within [first1,last1) according to comp. False otherwise.
This operation expects both [first1,last1) and [first2,last2) to be sorted. Searches for the presence of each element in [first2,last2) within [first1,last1), using comp to decide. The iterators over each range only move forward, so this is a linear algorithm. If an element in [first2,last2) is not found before the search iterator reaches last2, false is returned.
Definition at line 3520 of file stl_algo.h.
π¦ std::includes (the plain ol' one) π¦
template<typename _InputIterator1 , typename _InputIterator2 > bool std::includes (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) [inline]
Determines whether all elements of a sequence exists in a range. no comparison functor needed, she's doing it herself πββοΈ
Parameters:
first1β Start of search range.last1β End of search range.first2β Start of sequencelast2β End of sequence.
Returns:
True if each element in [first2,last2) is contained in order within [first1,last1). False otherwise.
This operation expects both [first1,last1) and [first2,last2) to be sorted. Searches for the presence of each element in [first2,last2) within [first1,last1). The iterators over each range only move forward, so this is a linear algorithm. If an element in [first2,last2) is not found before the search iterator reaches last2, false is returned.
Definition at line 3470 of file stl_algo.h.
π std::set_difference (with _Compare) π
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) [inline]
Return the difference of two sorted ranges using comparison functor. it's giving "what's in A that's not in B" β¨
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.compβ The comparison functor.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in the first range but not the second in order to the output range. Iterators increment for each range. When the current element of the first range is less than the second according to comp, that element is copied and the iterator advances. If the current element of the second range is less, no element is copied and the iterator advances. If an element is contained in both ranges according to comp, no elements are copied and both ranges advance.
β οΈ bestie listen to me: the output range may not overlap either input range. no cap, that's a hard no.
Definition at line 5806 of file stl_algo.h.
π std::set_difference (no functor) π
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) [inline]
Return the difference of two sorted ranges.
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in the first range but not the second in order to the output range. Iterators increment for each range. When the current element of the first range is less than the second, that element is copied and the iterator advances. If the current element of the second range is less, the iterator advances, but no element is copied. If an element is contained in both ranges, no elements are copied and both ranges advance.
β οΈ again, and I mean this lovingly: the output range may not overlap either input range.
Definition at line 5745 of file stl_algo.h.
π std::set_intersection (with _Compare) π
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_intersection (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) [inline]
Return the intersection of two sorted ranges using comparison functor. the "both of us" energy, we love a shared moment ππ
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.compβ The comparison functor.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in both ranges in order to the output range. Iterators increment for each range. When the current element of one range is less than the other according to comp, that iterator advances. If an element is contained in both ranges according to comp, the element from the first range is copied and both ranges advance.
β οΈ the output range may not overlap either input range. periodt.
Definition at line 5687 of file stl_algo.h.
π§ std::set_intersection (no functor) π§
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_intersection (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) [inline]
Return the intersection of two sorted ranges.
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in both ranges in order to the output range. Iterators increment for each range. When the current element of one range is less than the other, that iterator advances. If an element is contained in both ranges, the element from the first range is copied and both ranges advance.
β οΈ output range may not overlap either input range β I will keep saying it until it sticks π«Ά
Definition at line 5630 of file stl_algo.h.
π std::set_symmetric_difference (with _Compare) π
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_symmetric_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) [inline]
Return the symmetric difference of two sorted ranges using comparison functor. it's the "one of us but not both" chaos, main character energy fr fr π₯
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.compβ The comparison functor.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in one range but not the other in order to the output range. Iterators increment for each range. When the current element of one range is less than the other according to comp, that element is copied and the iterator advances. If an element is contained in both ranges according to comp, no elements are copied and both ranges advance.
β οΈ say it with me now: the output range may not overlap either input range.
Definition at line 5930 of file stl_algo.h.
β std::set_symmetric_difference (no functor) β
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_symmetric_difference (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) [inline]
Return the symmetric difference of two sorted ranges.
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in one range but not the other in order to the output range. Iterators increment for each range. When the current element of one range is less than the other, that element is copied and the iterator advances. If an element is contained in both ranges, no elements are copied and both ranges advance.
β οΈ output range may not overlap either input range. iconic warning, don't ignore her π
Definition at line 5864 of file stl_algo.h.
π std::set_union (with _Compare) π
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Compare > _OutputIterator std::set_union (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) [inline]
Return the union of two sorted ranges using a comparison functor. everybody's invited to this party π
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.compβ The comparison functor.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in each range in order to the output range. Iterators increment for each range. When the current element of one range is less than the other according to comp, that element is copied and the iterator advanced. If an equivalent element according to comp is contained in both ranges, the element from the first range is copied and both ranges advance.
β οΈ you already know: the output range may not overlap either input range.
Definition at line 5563 of file stl_algo.h.
πΈ std::set_union (no functor) πΈ
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator > _OutputIterator std::set_union (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) [inline]
Return the union of two sorted ranges.
Parameters:
first1β Start of first range.last1β End of first range.first2β Start of second range.last2β End of second range.
Returns:
End of the output range.
This operation iterates over both ranges, copying elements present in each range in order to the output range. Iterators increment for each range. When the current element of one range is less than the other, that element is copied and the iterator advanced. If an element is contained in both ranges, the element from the first range is copied and both ranges advance.
β οΈ last time, promise: output range may not overlap either input range π«Ά
Definition at line 5496 of file stl_algo.h.
π AUTHOR π
Generated automatically by Doxygen for libstdc++ from the source code. not a human, just a very diligent little robot doing her thing β¨π€
okay bestie that's the whole page!! you ate that ngl π β¨
libstdc++ β 21 Apr 2009 β Set Operation Algorithms(3)
now go forth and sort your ranges first, or none of this works, iykyk π¦π
π¦ where this page comes from
- nixpkgs unstable: std-man-pages 4.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms