`Description`

`Description`

```
```*Set_symmetric_difference *constructs a sorted range that is the set symmetric 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_symmetric_difference* performs a set theoretic calculation: it constructs the union of the two sets *A – B* and *B – A*, where *A* and *B* are the two input ranges. That is, the output range contains a copy of every element that is contained in *[first1, last1)* but not *[first2, last2)*, and a copy of every element that is contained in *[first2, last2)* but not *[first1, last1)*. 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 *|m-n|* times in the output range. [1]* Set_symmetric_difference* is stable, meaning that the relative order of elements within each input range is preserved.

The two versions of *set_symmetric_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*.