[sigc] arguments copied on lambda invokation



Hello,

should the following be possible with sigc++?

<code>
std::list<int> alist;
alist.push_back(1);
std::for_each(alist.begin(), alist.end(), sigc::_1 = 1);
</code>


I'm just asking because the list itself is not modified.
Because when for_each calls the lambda then the passed list item is copied due to lambda_core's signature of operator() and the copied value is modified, not the list item itself.


--
Klaus Triendl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]