Hi guys,
I really confused and don’t understand what wrong.
I have a struct, like this:
USTRUCT(BlueprintType)
struct MY_PROJECT_API FMyStruct {
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FOtheStruct other;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int amount;
FORCEINLINE FMyStruct();
FORCEINLINE void clear() {
other = FOtheStruct();
amount = 0;
}
}
so, I using this struct in my blueprints and Unreal Editor crasing any time when I invoke method FMyStruct::clear()
The solution is to remove line:
other = FOtheStruct();
and code works fine. But sometimes I need to construct other struct with a struct constructor.
I have readed this article about structs and author used struct constructors in the code examples.
Question is: how to use struct constructors in C++ code?
Thanks!