Hi,
is it somehow possible to pass param_1 to the function used by std::for_each?
Thank you in advance!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); }



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.
CornedBee

