template
TSubclassOf<T>ToSpawn if(ToSpawn==AActor) {do this} else {do that}
I know can do this with function with a similar name but I want to know that I can compare Template or not in ue4 ? IsA() seems not working here. if its work how ? is_same::value seems not working too! if it works please guide me how ?!
Hello,
I’m guessing you want to compare the template class to an actor? Then this is how I do it:
// .h template<typename T = AActor> TSubclassOf<T> ToSpawn; // .cpp if (ToSpawn.Get() == AActor::StaticClass()) { } else { }
~ Dennis “MazyModz” Andersson