[sigc] arguments copied on lambda invokation
- From: klaus triendl <triendl kj aon at>
- To: libsigc-list gnome org
- Subject: [sigc] arguments copied on lambda invokation
- Date: Tue, 10 Oct 2006 23:40:32 +0200
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]