3 ms·
Is it me, or is the C++ reflection syntax goofily obtuse on purpose? Years ago, in grad school, I modified GCC to add operator overloading "for the rest of C++"
by thechao 2y ago
Is it me, or is the C++ reflection syntax goofily obtuse on purpose? Years ago, in grad school, I modified GCC to add operator overloading "for the rest of C++".:
operator if (C, T, E);
operator ; (A, B);
operator {} (A);
:
And just used pattern matching, expression templates, and an unjustified belief in the good will of the compiler to cover reflection (introspection & generation).
I refuse to believe the first thing I thought of ~20 years ago is somehow more elegant than this proposal...
- steveklabnik 2y agoThis blog post doesn’t show the final syntax, there is another paper in progress that simplifies things.
- thechao 2y agoJaakko (Järvi), Gaby (dos Reis), and especially Bjarne would foist syntax on us graduate students just to see how we'd "naturally" respond to language feature proposals quite early on in the feature development cycle. That'd provide immediate feedback, because syntax can become a pretty unworkable constraint & torpedo a great idea. That's why Bjarne's original proposal for unified initializers was changed: none of us could figure out WTF the code was saying.