by 0xFFC · 9y ago · 0 comments
Update: From Herb's blog :
"Also, a vocal minority in the committee strongly want a syntax that does not include the $ character (not just for $class, but also for $expr reflection) because they have large code bases that use $ in source code that is not C++ code but is processed to emit C++; removing $ is an easy change at any time and we’ll just follow what the committee decides for reflection syntax (in fact, the alternative syntax I showed in the endnote above removes the need to write $). So further work is needed on those items, but fortunately none of it affects the core model."
https://herbsutter.com/2017/07/26/metaclasses-thoughts-on-ge...
P.S. I really hope that vocal minory would win ;)
But overall the proposal is what I have been talking about for a long time.
meta::type interface(const meta::type source) {
// … basically same code …
};
[1] https://herbsutter.com/2017/07/26/metaclasses-thoughts-on-ge...I am very interested in having Reflection in C++. But tbh $ makes it really awkward.
`reflexpr interface {...}` could be declaring and initializing a global.
`$class`, on the other hand, doesn't compile. One could also do `virtual class` or something, I guess, since `virtual class` is a combination of reserved keywords.