5 ms·
If the best example is interfaces, why not just add interfaces, instead of having every library contain its own slightly incompatible implementation of them?
by mcphage 9y ago
If the best example is interfaces, why not just add interfaces, instead of having every library contain its own slightly incompatible implementation of them?
- jcelerier 9y agoA much more interesting example is the replacing of Qt or Windows's meta-object compilers with purely in-language features and without resorting to macros.
- yoz-y 9y agoThe ship has probably sailed but had C++ had reflection back when, maybe the whole Qt paradigm could do without MOCs. I feel that with C++ we have backed ourselves into a complexity corner and now building more stuff to get out of it while retaining old habits.
- jcelerier 9y ago> The ship has probably sailed but had C++ had reflection back when, maybe the whole Qt paradigm could do without MOCs. well that's exactly a motivating example of the metaclasses paper: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r2.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p070...
- bluGill 9y agoThat is best only in the context of easy to explain and understand. As soon as I saw the proposal I thought of 3 different uses for this that are very specific to my domain. None of them are easy to explain unless you know our implementation (which I of course cannot talk about publicly) As the other poster said, qt moc is another example of where meta classes can make things easier, but explaining how it works would take much more code with no other benefit.