The class/parameter names in the prototype do not match the version in the header file. Some have been modified to improve readability.

The swap function swaps the two controlled sequences. The begin function returns a bidirectional iterator that points at the first element of the sequence. The end function returns a bidirectional iterator that points just beyond the end of the sequence.

s1.insert(5)
s1.insert(10)
s1.insert(15)
s2.insert(2)
s2.insert(4)
swap(s1,s2)
s1 has 2 in its set.
s1 has 4 in its set.
s2 has 5 in its set.
s2 has 10 in its set.
s2 has 15 in its set.
s1.swap(s2)
s1 has 5 in its set.
s1 has 10 in its set.
s1 has 15 in its set.
s2 has 2 in its set.
s2 has 4 in its set.