Yeah, add a serialize() to the struct that does ar << a << b << c etc, and the same for loading (ar >> a >> b >> c). Then to save the whole vector, save the size, then for each element, call its serialize(). To load it, load the size, clear the vector, then for each element serialize() it in to a temporary struct and push it back to the vector.