October 27, 2025 —

Every once in a while, you come across an optimization that is so mind-blowingly weird, that you feel like you’re peering into some sort of alternate dimension.

Until recently, I believed that metaprogramming is basically just normal C++ templates with a few neat features like constexpr thrown on top. I thought it was just “writing code that writes code”, like we’ve been doing with PHP since the dawn of time. Simple stuff, right?

If you believe that like I did, buckle up! I’m going to show you how metaprogramming can be used to unlock what I call the impossible optimization.

And I don’t just mean little 5% optimizations. I’m talking about crazy optimizations that make your code ten times faster.

Big shout-out to Alexandros Naskos’s [ctregex](https:/…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help