Capturing lambdas by reference