What\'s the fastest way to reset every value of a std::vector to 0 and keeping the vectors initial size ?
std::vector
A for loop with the [] operator ?
If it's just a vector of integers, I'd first try:
memset(&my_vector[0], 0, my_vector.size() * sizeof my_vector[0]);
It's not very C++, so I'm sure someone will provide the proper way of doing this. :)