Re: Can lambda expressions have const-qualifiers?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
Am 19.01.13 16:22, schrieb Daniel Kr?gler:
Theoretically this would be possible. I'm not so sure that this is
really a sufficient reason to extend the rules in that way,
though.
Sometimes I wish I could move-initialize the captured values,
especially when working with std::function like in:
typedef std::function<void(std::string const&)> Callback;
Callback twice(Callback c)
{
//will copy "c", but I want to move it into the lambda:
return [c](std::string const& s){
c(s); c(s); // call twice
};
}
The std::function does not do reference counting, does it? QOI?
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: keyserver x-hkp://pool.sks-keyservers.net
iEYEARECAAYFAlD8QN8ACgkQhAOUmAZhnmqARwCfSkC9/XCoEy+gPGZLj6Sp1wU4
P1UAnilqFzHoeMXZTMBE04Z5Q8Lzwgdy
=D1O5
-----END PGP SIGNATURE-----
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]