0

In a C++ Lambda, if I write

auto lbd = [&](...){...};

I allow it to capture variables visible in the scope by reference. I would like to know if it is possible to specify that only const references may be captured. Is there such a thing as:

auto lbd = [const &](...){...};

? It would be a way to let it have access to its environment without risking mutating it.

Ludovic Aubert
  • 9,534
  • 4
  • 16
  • 28

0 Answers0