I’ve read some examples at Wikipedia but I’m looking for some real-life examples: how is introspection used, why (does it help to write clean code) and the code itself.
For example, is there a way to create a “generic” function to serialize any kind object? I mean: only one function in the parent, and all the descendent could be able to “save” + “restore” themselves into/from a file.
It isn’t used (since it doesn’t exist), there’s no code examples (since it doesn’t exist), and there’s no reason to attempt to use it (since it doesn’t exist).
The closest you can get is RTTI/
dynamic_cast. But that’s not really introspection.