What is the reason of QVector's requirement for default constructor?
问题 I can see that that classes are treated as complex objects which are required for calling default constructor: void QVector<T>::defaultConstruct(T *from, T *to) { if (QTypeInfo<T>::isComplex) { while (from != to) { new (from++) T(); } ... } But it's not clear why is it needed to construct objects in the 'hidden' area of QVector. I mean these objects are not accessible at all, so why not just to reserve the memory instead of the real object creation? And as a bonus question, I would like to