Let's say I have a struct containing a list of std::vector
objects that are all empty. Then the struct is part of a larger contiguous, dynamically allocated memory region and all of that is zeroed with memset
(which is not something I can change). Now I'd like to re-construct the vector objects just not to have an undefined behavior later on when I use them (the vectors do seem to function fine even without explicitly reconstructing them, but I'm not sure if that is a behavior I can rely on).
typedef struct {
// many other members
std::vector<someClass> listOfVectors[10];
// many other members
} mystruct;