[Cs3] lambda caption by const reference

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Oct 10 15:41:33 EDT 2016


CS3 students,

lambda caption by const reference is not available as an explicit
construct. However, if there is a constant in the contents, and it is
being explicitly captured by reference, it becomes a const reference
capture. For example

....
cont int i=55;

...[&]{i++;}; // not allowed: i is captured by reference and then modified.

thanks,
-- 
Mikhail


More information about the cs3 mailing list