vector(size_type count) constructs the container with count default-inserted instances of T. So, current code will end up with 2*num elements which is wrong.
vector(size_type count) constructs the container with count default-inserted instances of T. So, current code will end up with 2*num elements which is wrong.