TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

C++23: Removing CR from CRTP(Curiously Recurring Template Pattern)

13 pointsby mrv_asuraalmost 2 years ago

2 comments

seeknotfindalmost 2 years ago
This is cool. From my perspective, the main thing you get with this is less memory usage. Since less things are template instantiated, you&#x27;ll have smaller programs. Unfortunately, converting CRTP to this is a binary interface change, so it could cause wide churn.<p>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&#x27;t expecting it.
评论 #36853321 未加载
defatigablealmost 2 years ago
Great writeup, I didn&#x27;t really understand what was going on with CRTP (and what c++23 had to do with it) until I read this.