C++ function and blueprint function look different

I may have misunderstood what you mean changing into
void APlayerC::SortActorsByDistance(const TArray<AActor*>& Actors).

What happened is, I literally added ‘const’ in my cpp file’s SortActorsByDistance.
And as I add const on my code I get a bunch of error lines

even where they aren’t relevant with SortActorsByDistance and causes build/compile errors.
This also happens when I add the ‘const’ only in my header file’s SortActorsByDistance

UFUNCTION(BlueprintCallable)
		void SortActorsByDistance(const TArray<AActor*>& Actors);

like this, and adding const in both header file and cpp file does so.

Did I do what you intended or not? I’m honestly just asking whether this is right or not, I need a lot of help to dig in c++.