cpp/algorithm/set difference

Copies the elements from the sorted range which are not found in the sorted range  to the range beginning at. The output range is also sorted.

If contains  elements that are equivalent to each other and  contains  elements that are equivalent to them, the final  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