Substitute lambdas with equivalent 'const'.