class Vector { explicit Vector(int num_slots); // Creates an empty vector with `num_slots` slots. int RemainingSlots() const; // Returns the number of currently remaining slots. void AddSlots(int num_slots); // Adds `num_slots` more slots to the vector. // Adds a new element at the end of the vector. Caller must ensure that RemainingSlots() // returns at least 1 before calling this, otherwise caller should call AddSlots(). void Insert(int value); }
class Vector { explicit Vector(int num_slots); // Adds a new element at the end of the vector. If necessary, // allocates new slots to ensure that there is enough storage // for the new value. void Insert(int value); }