The elements contained in the object before the call are dropped, and replaced by copies of those in set x, if any.
After a call to this member function, both the set object and x will have the same size and compare equal to each other.
Parameters
- x
- A set object with the same class template parameters (Key, Compare and Allocator).
Return value
*thisExample
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Output:
Size of first: 0 Size of second: 5 |
Complexity
Linear on sizes (destruction, copy construction).See also
| set::insert | Insert element (public member function) |
| set::set | Construct set (public member function) |
