r/cpp • • Mar 10 '26

Deriving Type Erasure

https://david.alvarezrosa.com/posts/deriving-type-erasure/
59 Upvotes

34 comments sorted by

View all comments

Show parent comment

2

u/Business_Welcome_870 Mar 10 '26

Someone made a post in another sub about creating a tuple that the user didn't have to specify the template arguments for. CTAD wouldn't cut it. So he created a new class and wrapped a tuple around it in an any. Template tricks were used to convert the any back to the correct type when the user wanted.

1

u/david-alvarez-rosa Mar 10 '26

Nice! Would you like to share the link?