How do I write a UFunction that accepts an array of any type as an argument. In normal c++ I would be able to use templates but unreal engine throws an error when templates are used. Is there an equivalent to templates in unreal c++?
Here is a simple example of what I have tried.
UCLASS()
class Test UFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "Custom", meta = (Keywords = "HelperMethods"))
template <typename T>
static bool CheckIfEmpty(TArray<T> objectArray)
{
if(objectArray.empty())
{
return true;
}
return false;
};
};
When compiling I get an error stating template is an unrecognized type and must be a UCLASS, USTRUCT, or UENUM.