# UE5.8  error C2280: attempting to reference a deleted function 

**URL:** <https://forums.unrealengine.com/t/ue5-8-error-c2280-attempting-to-reference-a-deleted-function/2743270>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine\
**Created:** [August 12, 2026, 2:39pm UTC](https://forums.unrealengine.com/t/ue5-8-error-c2280-attempting-to-reference-a-deleted-function/2743270 "2026-08-12T14:39:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrMod3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMod3](https://forums.unrealengine.com/u/MrMod3)\
**Post date:** [August 12, 2026, 2:39pm UTC](https://forums.unrealengine.com/t/ue5-8-error-c2280-attempting-to-reference-a-deleted-function/2743270/1 "2026-08-12T14:39:56Z")

</div>

### Summary

I have created these enums:  
CommonENUMS.h

```auto
UENUM(BlueprintType)
enum class EActorType : uint8
{
	//Pawn Types
	Villager UMETA(DisplayName ="Villager"),
	Swordman UMETA(DisplayName ="Swordman"),
	Knight UMETA(DisplayName ="Knight"),
	Archer UMETA(DisplayName ="Archer"),
	
	//Building Types
	House UMETA(DisplayName ="House"),
};

```

BaseBuilding.h

```auto
UPROPERTY(EditAnywhere,BlueprintReadOnly, Category=Building, meta=(AllowPrivateAccess=true))
	EActorType ActorType = EActorType::House;

```

BaseBuilding.cpp

```auto
void ACLMBaseBuilding::RevertBuildingPlacementCost()
{
	FString ActorTypeStr = UEnum::GetValueAsString(EActorType::House);
//FString ActorTypeStr = UEnum::GetValueAsString(ActorType);
	//FString ActorTypeStr = "House";
	FString CleanNameStr = "House";
	//ActorTypeStr.Split(TEXT("::"),nullptr,&CleanNameStr);
	FActorBuildCost* BuildCost = DTBuildCost->FindRow<FActorBuildCost>(FName(CleanNameStr),TEXT(""));
	
	if (BuildCost)
	{
		ATopDownPlayerState* PlayerState = Cast<ATopDownPlayerState>(GetWorld()->GetFirstPlayerController()->PlayerState);
		UE_LOG(LogTemp, Warning, TEXT("RevertBuildingPlacementCost for %s"), *ActorTypeStr);
		PlayerState->RevertBuildCost(BuildCost->BuildCost);
	}
}

```

On this line I get error:

```auto
FString ActorTypeStr = UEnum::GetValueAsString(EActorType::House);

```

```auto
 [1/1] Compile [x64] CLMBaseBuilding.cpp
  C:\Program Files\Epic Games\UE_5.8\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h(3338,22): error C2280: 'UEnum *StaticEnum<EnumType>(void)': attempting to reference a deleted function
          with
          [
              EnumType=EActorType
          ]
  		UEnum* EnumClass = StaticEnum<EnumType>();

```

It points to Class.h

```auto
template<typename EnumType>
	inline static FName GetValueAsName(const EnumType EnumeratorValue)
	{
		// For the C++ enum.
		static_assert(TIsEnum<EnumType>::Value, "Should only call this with enum types");
		UEnum* EnumClass = StaticEnum<EnumType>();
		check(EnumClass != nullptr);
		return EnumClass->GetNameByValue((int64)EnumeratorValue);
	}

```

Cant figure it out, could someone help with this issue?

### What Type of Bug are you experiencing?

Editor

### Steps to Reproduce

Call enum GetValueAsName on enum

### Expected Result

Return string of Enum

### Observed Result

Gives error, that enum no longer exist

### Affects Versions

5.8

### Platform(s)

Windows
