So I'm making a application framework, every class basically inherits YObject
, my Application
manager handles any object that gets added to the class and stores them in: vector Application::ApplicationObjects`, I want to make a function like
ObjectType* object = Application->object_of<ObjectType>();
I'm not really sure how exactly to do this, I've heard one of the C++ casts can be used to determine if ObjectType
derives from YObject
, but I'm not sure!
EDIT:
Since its important to make understandable questions that can be researched or whatever..
What I was trying to make was a template function that would loop through all available objects and check if the current object could be cast to the template defined type.