How do I initialize a stl vector of objects who themselves have non-trivial constructors?
There are many ways to get there. Here are some of them (in no particular order of presence). Use vector(size_type n, const T& t) constructor. It initializes vector with n copies of t. For example: #include <vector> struct MyInt { int value; MyInt (int value) : value (value) {} }; struct MyStuff { std::vector<MyInt> values; …