When using AddUnique to add a new structure to a TArray of structures, VisualStudio returns this error:
Error C2678 binary '==': no operator found which takes a left-hand operand of type 'const FWeaponState' (or there is no acceptable conversion)
This is my structure setup:
USTRUCT(BlueprintType)
struct FWeaponState
{
GENERATED_BODY()
EWeaponState state;
int32 priority;
FTimerHandle* state_timer;
bool bInfinite;
bool bDestroyIfInactive;
};
The function that causes the error when trying to compile (StateBuffer is the TArray):
StateBuffer.AddUnique(new_state);
I’m unsure if this is intended/expected or just a limitation, but I’m posting this here because I couldn’t find any info about it online.