I need to initialize a vector for use as a buffer. I don't care what values it contains before I put something in it, so I don't want the program to waste time filling it with zeroes. I know about with_capacity, but it requires me to push() elements, which is inconvenient because I would need to constantly check if I have pushed something to an index before or not.
Basically, I'm looking for an equivalent of this C++ array:
int* arr = new int[size];
arr[2]; // random garbage