Can this lambda be replaced with `const` somehow?