I have an std::vector of objects. For each object in the vector, I want to modify the value of an object member. The following thoughts came into my mind:
If I had a vector of primitives, I would use
std::fillto do that. However, I cannot imagine how to applystd::fillto a vector of objects.I know that I could definitely iterate over all objects using an iterator but that is much code for a tiny task.
What is the best way to modify the value of an object member for all objects in std::vector?