c++ - Calling a static class method using a class type template -
i've seen questions no definite answer if possible other way/if should done differently. have this:
template <typename t> static t* selfspawn(uworld* world, aactor* ownerparam) { if(!world) { return nullptr; } factorspawnparameters params = factorspawnparameters(); params.owner = ownerparam; t* thisactor = world->spawnactordeferred<t>(t::staticclass(), ftransform(frotator(0.f, 90.f, -90.f))); aactor* newactor = ugameplaystatics::finishspawningactor(thisactor, ftransform(frotator(0.f, 90.f, -90.f))); return cast<t>(newactor); }
t::staticclass() throw error because doesn't know sure if t class type. question is, there anyway template specialization or guarantee t class type work?
Comments
Post a Comment