I have a lot of code which looks like this:
MyDerivedType@ foo = cast<MyDerivedType>(database.FindObject("foo"));
...
MyOtherDerivedType@ bar = cast< MyOtherDerivedType >(database.FindObject("bar"));
Is there any existing way to have something like a templated function? The syntax I'd like to have is (for example):
MyDerivedType@ foo = database.FindObject<MyDerivedType>("foo");
Thank you.