The C++ Metaclasses Proposal in Less Than 5 Minutes
fluentcpp.com
fluentcpp.com
I'm not sure the C++ commitee would agree with you. Every change adds to the language and hence, in a certain sense, makes things more complex, yes. But the idea is to add simpler alternatives to some current terrible stuff.
As for metaclasses, they enable to define some fairly clean "class contracts", i.e. it constraints how some class can be implemented - and will report a clean error message at compile-time if the constraints are breached. Contrast to the current situation where failing to respect such a contract will make your program blow up at runtime or generate a byzantine template error at compile-time.
You can always add, but it's so very difficult to take away.
I'm sure I'm just used to things the way they are, but this does not seem to me like a strongly motivating example for metaclasses.
Seriously, once you are good at functional programming (which haskel will give you) C++ templates are just a syntax problem: you should be able to learn that awful syntax in 6 months once you don't have the overhead of trying to learn functional programming at the same time.
Better to always use struct and never class, or the opposite. Always class is simpler because the first members declared in most classes are public, and struct saves you typing "public:" at the top of every class. But always class has the advantage that it is far more popular in C++ library code...including std::array which has no invariants.
Do you have something in mind that might be more complicated?
well that's exactly a motivating example of the metaclasses paper: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p070...
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.