this post was submitted on 15 Sep 2025
79 points (87.6% liked)
Programmer Humor
38564 readers
229 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Back when I made this, GCC/clang were crashing left and right while compiling my project because of constexpr and auto usage with nested lambdas. It got worse with every template being evaluated until the compiler and my IDE started crashing.
I was making a react-like UI component library with all the new bells and whistles of modern C++. It was fun at first then the issues cropped up and it kinda killed my passion for the language and drove me away entirely.
Not sure about its state nowadays though.
I see. I think auto gets overused a lot by people just being lazy about writing out the full type, but constexpr is good practice in my opinion. Never had a compiler issue with them, but then I don't think I've ever used a nested lambda either.
The problem is that lambdas with a capture ~~aren’t strongly typed~~ are uniquely typed, so you have to use decltype/auto. And if you pass such a lambda to a function you’ll have to use auto as well.
If you write a lambda with a capture that calls itself recursively you’ll have to pass it to itself as an auto argument as part of the call signature.
I think this article explains it better: https://artificial-mind.net/blog/2020/09/12/recursive-lambdas
Edit: fixed wrong terminology
This is an entirely new way to misuse "strongly typed" that I was not aware of before. Amazing.
Thank you!
You’re welcome. Just don’t blame me when your brain starts cursing in foreign languages you don’t even know. ;)