# USTRUCT has no appropriate default constructor

**URL:** <https://forums.unrealengine.com/t/ustruct-has-no-appropriate-default-constructor/476460>\
**Category:** Editor Scripting\
**Tags:** Struct, ustruct, constructors, unreal-engine, CPP, question\
**Created:** [December 27, 2020, 6:28pm UTC](https://forums.unrealengine.com/t/ustruct-has-no-appropriate-default-constructor/476460 "2020-12-27T18:28:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AgentArachnid66](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AgentArachnid66](https://forums.unrealengine.com/u/AgentArachnid66)\
**Post date:** [December 27, 2020, 6:28pm UTC](https://forums.unrealengine.com/t/ustruct-has-no-appropriate-default-constructor/476460/1 "2020-12-27T18:28:06Z")

</div>

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](https://answers.unrealengine.com/questions/272091/ustruct-constructor.html) 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	

```

---

<div class="post-metadata">

**Author:** ![iOSak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iOSak](https://forums.unrealengine.com/u/iOSak)\
**Post date:** [February 15, 2021, 9:01am UTC](https://forums.unrealengine.com/t/ustruct-has-no-appropriate-default-constructor/476460/2 "2021-02-15T09:01:39Z")

</div>

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