Why don't std::vector's elements need a default constructor?
And how can I write my own array class to not need a default constructor for its elements? Right now, when I do the new [] to allocate space, I need a default constructor. std::vector does not. How do they do this magic? std::vector doesn't need the default constructor because it never uses it. Every time it needs to construct an element, it does it by using the copy constructor , because every time it has something to copy: either existing vector element or an element you yourself supplied for copying through a method's parameter (explicitly or implicitly, by relying on a default argument )