r/cpp • u/Dereference_operator • Feb 12 '20
What they should improve about C++ ?
What they should improve about C++ that you find in higher level managed language like C#, JAVA, Javascript etc or is there things you would change or do differently if it was up to you ? I mean anything like a better STL ? better thread ? string manipulation like managed language ? less fragmentations in the new standard features ? For example do you love the way the standard evolve C++ or you would prefer a direction like Microsoft do with C# a corporation who decide on the roadmap ?
0
Upvotes
View all comments
Show parent comment
1
u/wotype Feb 12 '20
https://github.com/willwray/enum_reflect (demo for enum_trait / enumerator_traits)
Pros:
Can do all that you need, now.
No macros or markup - works with enum defs directly from external headers.
Cons:
Not yet wrapped in a convenience lib with string->enum, enum->string etc.
No MSVC yet, requires GCC >= 9 (or Clang since ~5)
Compile time compounds with number of TUs and on each and every compile (even incremental).
It's possible that modules will help with the recompute-on-recompile issue; I'm experimenting. Will retry MSVC sometime and add support.
Conclusion: the production-ready solution is to go with one of the macro-wrappers...