You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GW1/GW1-2/lambda-partmutable.cc

15 lines
238 B

#include <iostream>
int main()
{
int x = 2, y = 3;
auto a = [x,mutable y](){
y++;
std::cout << "y: " << y << std::endl;
};
a();
std::cout << "y: " << y << std::endl;
}
//Partially Mutable Lambda Captures: P2034R0