Cast to wildcard/class?

Mmmh … I get your point. But imagine the following:

I have a parent class to roughly 5 classes. They’re all “singletons”, so I want to create a “get” function that would return a reference to any of the 5 instances based on an input parameter (which would be a class type). Now the only way I can see myself doing that is by manually adding a cast node for every class, which I don’t really want to do especially if I end up adding more than just the 5 classes.

If I could specify the class to cast to, I’d only need the one node. My only worry would be to get a reference to each instance to pass in as object.

Does it kinda make sense?