Hi everyone, can somebody tell me in laymans terms what object reflection is, and in what OOP programming situation would you want to apply object reflection. I am aware that C++ does not have this feature but I'm using the Qt library with C++ which allows this feature.
Last edited on
Reflection allows you to write code that examines other running code, e.g. you can write code to list out all the class members of a class and the member functions and what parameter types they take.

It is normally used in rare cases where you would not otherwise be able to obtain that information. An example is that some languages use reflection to implement a simple "print" function that prints a variable based on its type.
Last edited on
Topic archived. No new replies allowed.