I have the following code to assign a value to all the elements of a vector:
x = 100;
for (int i=0;i<vect.size();i++)
{
vect[i] = x;
}
It's straightforward enough, but I'm wondering if there is a function in the STL that does the same thing; something like for_each, but for assignment.