Let's say I have the following class: (maybe meta-generated)
class MyClass { public: myMethod(); ... }
Assuming a few things here:
1.) I have the class name from somewhere (let pretend) 2.) I have the names of the class methods somewhere ( std::map< std::string, std::function> ... perhaps? )
So ... since I may not know the name myMethod() before runtime, is there a way to call it using std::string ? This assumes that I have class function names that are stored somewhere.
MyClass example; std::string funcName{ findMyMethod() };
I know that C ++ is usually not suitable for situations like introspection, but I would like to understand this.
Thanks!
source share