I'm developing a class for building records (with a fixed number of fields). My public methods allow the user to insert individual values by index. There's no requirement that the user fill in all fields -- so I'd like to preallocate the vector that represents the record to the exact size, with every field initialized to the empty string.
Is there a way to do this more easily than with a push-back loop?