There is no need to write your own destructor for this class, unless you want some sort of special behavior (e.g. a screen output)
Incidentally, your constructor first consructs an empty vector and then calls vector::assign(). You could just construct it directly with foo::foo(int i) : vec(i) {}
Thanks for the reply! So, is it because vector is STL container and so, even though it does dynamic memory allocation, the compiler will take care of that?
Yeah you are right, I need to start using initializer lists more.