Attempting to return a const pointer from a UFUNCTION will cause a VS compile error
The syntax
UFUNCTION(BlueprintCallable, Category = test)
const UMyActorComp* SomeFunc();
returns a VS compile error (@ GENERATED_BODY line) stating
Cannot convert from 'const UMyActorComp*' to 'UMyActorComp*'
This is likely related to [Link Removed]
UFUNCTION(BlueprintCallable, Category = test)
const UStaticMeshComponent* SomeFunc();
const UStaticMeshComponent* AMyActor::SomeFunc() { UStaticMeshComponent* Something; return Something; }
Result:
Compile fails with error mentioned in description
Expected:
Class compiles and UHT returns a const pointer
How does TextureRenderTarget2D get TArray<uint8> type data?
Why does the REMOVE method of map container remove elements have memory leaks?
What is the difference between Camera and CineCamera?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
How to delete some elements correctly when deleting an array loop?
UMG RichText not appear image when packaged
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-50745 in the post.
9 |
Component | UE - Foundation - Cpp Tools - UnrealHeaderTool |
---|---|
Affects Versions | 4.17.2, 4.18 |
Target Fix | 4.27 |
Fix Commit | 15018807 |
---|
Created | Oct 4, 2017 |
---|---|
Resolved | Jun 9, 2021 |
Updated | Jun 9, 2021 |
4081 - projectgheist |