USTRUCT has no appropriate default constructor

I’m trying to make a simple saving and loading system for my neural network, so have made a file containing my structs, which has the following USTRUCT
USTRUCT(BlueprintType)
struct FTopology {

	GENERATED_USTRUCT_BODY()

	// Got these variables so that I can load in different topologies for different purposes
	// Makes it easier to train and finetune neural networks as all I need to do is add a new topology for 
	// a new purpose without having to retrain a massive neural network.
	FTopology(FString n, TArray<FNeuralLayer> t) : topologyName(n), Topology(t) {}


	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		FString topologyName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		TArray<FNeuralLayer> Topology;
};

I found this question that seems similar, which is where I got the original constructor code. I’m not sure what I’m doing wrong, but here is the full error message:

Error	C2512	'FTopology::FTopology': no appropriate default constructor available	LeapNetUE4	C:\Program Files\Epic Games\UE_4.23\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h	609	

you need to add default constructor - FTopology() {}

3 Likes