4 ms·
> This reflection system is based on preprocessor macros and templates. C++, at least in its current form, was not designed to make runtime reflection easy. Th
by tomalpha 9y ago
> This reflection system is based on preprocessor macros and templates. C++, at least in its current form, was not designed to make runtime reflection easy.
This is something I’d love to see changed in an upcoming C++ standard. (I lose track of exactly what we are or aren’t getting with whatever’s coming next so it’s possible it is already...)
Creating C++ reflection systems seems to be a common need and oft-repeated. IMHO one of the appeals in doing so is that you have to be clever and use either complexity or tricks to make it work. That’s not intended to criticize the author here, but I would really like not to have to be clever in solving a common problem.
- jcelerier 9y ago> This is something I’d love to see changed in an upcoming C++ standard. (I lose track of exactly what we are or aren’t getting with whatever’s coming next so it’s possible it is already...) https://cppx.godbolt.org https://cppx.godbolt.org (and https://herbsutter.com/2017/07/26/metaclasses-thoughts-on-generative-c/ https://herbsutter.com/2017/07/26/metaclasses-thoughts-on-ge...)
- tomalpha 9y agoThanks for the info. It looks like we’ve a little while to wait, but there does at least appear to be a push for this kind of feature. I’ll keep my fingers crossed :)