total.clear(); //This will destroy all the objects
vector<timing>().swap(total); // This will create an empty vector with no memory allocated and swap it with totoal vector, effectively deallocating the memory.
and for your homework, I think you are expected to solve this naively, and assume that every value you retrieve has no spaces, so you can exclusively use the >> operator. Otherwise if you are explicitly told to include values with spaces, the best solution is to use the find function for the colon, and do a primitive loop, push every letter into another sting, and have a boolean for whether the previous letter is a space (this value starts off true). And depending if the order of keys are not hardcoded, you should use a std::map.