Hacker News new | past | comments | ask | show | jobs | submit login
C++23: Removing CR from CRTP(Curiously Recurring Template Pattern) (modernescpp.com)
13 points by mrv_asura on July 24, 2023 | hide | past | favorite | 2 comments



This is cool. From my perspective, the main thing you get with this is less memory usage. Since less things are template instantiated, you'll have smaller programs. Unfortunately, converting CRTP to this is a binary interface change, so it could cause wide churn.

The other limitation of this is that each calling site must specify the type it wants to use. This is more generic because the base type is no longer tied to a single type. However, it could lead to bad states if callers mix calls with multiple types on the same base instance which isn't expecting it.


Great writeup, I didn't really understand what was going on with CRTP (and what c++23 had to do with it) until I read this.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: