Chapter 8. Reflection
D supports limited runtime reflection out of the box as well as rich compile-time reflection that can be used in code generation efforts, custom semantic checks, building additional runtime reflection information, and more. In this chapter, we'll be covering the following recipes:
Getting dynamic runtime type information
Getting a list of child classes
Determining whether a module is available
Getting a list of all methods or fields in a module or an object
Inspecting function overloads
Determining names, types, and default values of function parameters
Getting components of complex types
Using user-defined attributes
Implementing a custom lint-style check for virtual functions
Extending the runtime type information
Creating a command-line function caller