`Description`

`Description`

```
```*Set_difference* constructs a sorted range that is the set difference of the sorted ranges *[first1, last1)* and *[first2, last2)*. The return value is the end of the output range.

In the simplest case, *set_difference* performs the "difference" operation from set theory: the output range contains a copy of every element that is contained in *[first1, last1)* and not contained in *[first2, last2)*. The general case is more complicated, because the input ranges may contain duplicate elements. The generalization is that if a value appears *m* times in *[first1, last1)* and *n* times in *[first2, last2)* (where *m* or *n* may be zero), then it appears *max(m-n, 0)* times in the output range. [1]* Set_difference* is stable, meaning both that elements are copied from the first range rather than the second, and that the relative order of elements in the output range is the same as in the first input range.

The two versions of *set_difference* differ in how they define whether one element is less than another. The first version compares objects using *operator<*, and the second compares objects using a function object *comp*.