From the standard, 25.3.5:
The semantics of given operations is generalized to multisets in a standard way, determining union()to contain the maximum number of occurrences of each element intersection(), to contain a minimum, etc.
So, in your example, the result will be (1,1,1,2,2,3,4,0,0,0), since you initialized a vector of length 10.
source
share