编写一个lambda,接受两个int,返回它们的和

void counter(int i, int b) {
	auto count = [i,b]{
		return i + b;
	};
	cout<<  count();
}

int main() {
	
counter(1, 2);
	return 0;
}

  

猜你喜欢

转载自www.cnblogs.com/lIllIll/p/10781145.html