[Cs3] capture by const reference

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Oct 8 20:55:16 EDT 2018


CS3 students,

There was a question as to whether lambdas allow captures by
const reference. For example:
      
      [const &m](){cout << m;}

It turns out as of C++11, it is not allowed. Newer standards provide
mechaisms to accomplish this, but we do not study them.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list