TArray<AActor*> Add

WHAT?! This compiles:



AAStar* cur = GetWorld()->SpawnActor<AAStar>(AAStar::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator);
TArray<AAStar*> stellarBodiesRef;
stellarBodiesRef.Add(cur);


but this does not compile:



stellarBodies.Add(cur);


as i have shown in previous posts i have declared stellarBodies and stellarBodiesRef both as TArray<AAStar*>. The only difference is stellarBodies is declared in the header file and stellarBodiesRef is declared locally in the function. Why am i able to add a pointer to one and not the other? stellarBodies is a UPROPERTY… maybe that has something do with it?

the error i get when adding to stellarBodies is:


 error C2663: 'TArray<AAStar *,FDefaultAllocator>::Add': 2 overloads have no legal conversion for 'this' pointer 

Also, in the intellisense it says “No instance of overloaded function”