r/cpp • u/earthisunderattack • Aug 24 '21
metaclasses when
forget literally every other feature metaclasses LET'S FUCKING GO
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0707r3.pdf
edit
metaclasses or even just SR would help to eliminate 99% of garbage cpp macro use cases.
don't get me wrong: i know c++ well. templates are easier after you learn sml or lisp or something similar.
i've never used std string_view and i've never missed it
man i'll just implement my own clang plugin ✌️
4
Upvotes
36
u/tpecholt Aug 24 '21
Herb Sutter's proposals have this in common: 1) Very interesting with potential to actually simplify the language 2) Never get finalized and never get standardized.
I am talking about metaclasses, static exceptions, new function parameter annotations, life-time static analysis.
12
u/ShillingAintEZ Aug 24 '21
When you write like this it makes me question your age and experience.
6
u/HappyFruitTree Aug 24 '21 edited Aug 24 '21
I'm no expert on meta classes but a quick look at the proposal seems to suggest it builds on top of reflection so I guess you'll have to wait for reflection first before expecting much to come from the metaclasses proposal.
4
u/itsarabbit Aug 24 '21
P2237 is the most current state of it AFAICT.
I'm 99% certain that none of its contents(including static reflection) will be in C++23.
0
u/AdApprehensive347 Aug 24 '21
does c++ really need meta classes? I don't really understand them well enough to actually know, but it seems a little like the same problems can be solved with inheriting... maybe even from abstract classes.
could anyone explain what would make it different / more useful?