`Description`

`Description`

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

In the simplest case, *set_intersection* performs the "intersection" operation from set theory: the output range contains a copy of every element that is contained in both *[first1, last1)* and *[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 *min(m,n)* times in the output range. [1]* Set_intersection* 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_intersection* 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*.