cpp/algorithm/set intersection

Constructs a sorted range beginning at consisting of elements that are found in both sorted ranges  and.

If contains  elements that are equivalent to each other and  contains  elements that are equivalent to them, the first  elements will be copied from  to the output range, preserving order.

@1@ Elements are compared using and the ranges must be sorted with respect to the same. @3@ Elements are compared using the given binary comparison function and the ranges must be sorted with respect to the same. @2,4@ Same as, but executed according to.

If either of the input ranges is not sorted (using or, respectively) or overlaps with the output range, the behavior is undefined.

Return value
Iterator past the end of the constructed range.

Complexity
Given and  as  and  respectively: @1,2@ at most comparisons using @3,4@ at most applications of the predicate