Problem using std::for_each
Hi,
is it somehow possible to pass param_1 to the function used by std::for_each?
Code:
std::vector<T> myCollection;
T t;
myCollection.push_back(t);
void function(T& _t)
{
_t.a_member(param_1); // can that param_1 somehow be transfered here?
// passing to function is not allowed, because then
// for_each can't use function because of the wrong signature
}
void do_something(T param_1)
{
std::for_each(myCollection.begin(), myCollection.end(), function);
}
Thank you in advance!