From Jason Turner
Watch on YouTube

Summary

This episode explores C++23's new feature that allows declaring static call operators for lambdas. Jason demonstrates how this feature can potentially improve performance by eliminating the need to pass a 'this' pointer when calling a lambda, particularly for captureless lambdas. Through assembly analysis of optimized versus non-optimized builds, he shows that static lambdas require one less register, which can lead to better compiler optimizations in larger codebases. Jason also notes that this was nearly the default design for captureless lambdas when they were introduced in C++11.

Resources

Tags