Hacker News new | ask | show | jobs
by green7ea 3865 days ago
There are use cases for which reflection is very useful. Things like automatic serialization are an obvious example. There's also automatic printing of complex types, automatic guis (think unity).

There are a few use cases which aren't very obvious like having a vector for each element in a structure instead of having a vector of the structure. This greatly improves cache locality and can be a great gain in performance for some applications.

Of course this is more introspection which is a specific case of reflection but all these examples are definitely not 'ugly hacks' and could greatly improve C++ as a language.