I can't use generic lambdas at compile-time, now what?

2026-10-11

This is a direct follow-up to my previous article, “Break MSVC and Clang with this one weird trick!”. In that article, I showed a solution for the problem in MSVC, but the problem in Clang seemed a lot more involved.

As of the time of writing, the problem in Clang still hasn’t been fixed, although it looks like it’s close to being fixed. I foresee it being fixed soon. The problem is, I’m trying to support Clang 16 and onward, so I have to make do with what we have.

This article will explain how to make this all work in Clang, and how I got there.