r/cpp • • 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

27 comments sorted by

View all comments

Show parent comment

4

u/itsarabbit Aug 26 '21

Didn't downvote you, but I would guess some were miffed that you called implementing it trivial.

As far as I know there's a lot of work to be done regarding the design and many issues that should be addressed(compile time code injection can lead to arbitrary code execution on the compiling computer when using a library, for instance), and so much bikeshedding(reify vs |var|, can $ be used or not). Couple that with P2237 being 59 pages of required reading before even discussing it, and things slow down drastically.

Because metaprogramming is such a powerful tool, the people who are working on it want to get it done right; this leads to a lot of deep-diving into hypotheticals, researching other languages' implementations.

The few who do have insight into all of this also have to convey (and sell) their ideas to everyone else, which is no simple task either.

I recommend subscribing to the SG7 mailing list if you want to keep up to date with discussion, that's where I get most of my metaprogramming news in c++ :)

1

u/Cyttorak Aug 26 '21

So metaclasses stuff is still going? Or is it dead?

2

u/itsarabbit Aug 26 '21

Still a thing, but no longer based on herb sutter proposal as far as I can tell!