Why is there no "New C++ Struct" option?

Under Tools, there’s an option “New C++ Class”, which allows the creation of C++ classes and to see what classes derive from what other classes.
Overall, it makes it way easier to create an unreal class, compared to manually writing the class from scratch.

But there’s no “New C++ Struct” option, while structs have the same issues of classes, it’s way harder to handwrite.

Is this a feature that’s coming or do we manually handwrite it each time?

This is for a few reasons.

  1. Structures rarely have their own file and the tools are built around creating new files for the new type. Structures tend to either be located with a class that uses it or in with a collection of other structures & types. They don’t tend to be on their own until much later if/when they get very large.

  2. Structures are much simpler. In general, structures don’t derive from other structures. While you can do that in C++ with structures in a way you can’t with Blueprint Structures it’s not really something that is made easy because its kind of an advanced feature that can really mess you up if you don’t know what you’re doing.

  3. It’s 3-5 lines of code (depending on what you’re counting). I don’t know how much easier you want it to be.

USTRUCT( )
struct FMyStruct
{
   GENERATED_BODY( )
};

That’s the extent of what a tool will save you. You still have to add all the properties on your own. I find the tool even less helpful to make classes because I don’t want to boot the Editor to make files that I need to close the Editor to compile (which you should absolutely be doing if you’re making new files).

You might be able to write a snippet to make this easier in your IDE of choice. Snippets are sort of like custom auto-completes that you can setup.

You forgot the include and the pragma.

// Copyright copywrong whatever

#pragma once

#include "MyStruct.generated.h"

USTRUCT()
struct YOUR_API FMyStruct {
    GENERATED_BODY()
};

7 lines excluding blanks (or 8 if you like your opening brace on a separate line). Maybe you also need #include CoreMinimal.h? I’m not sure about that one.

It’s likely possible to make a template in the New C++ Class wizard to create a struct (after all, some of the existing templates are decidedly not UObjects). I’m not sure how much work it would be or if it’s even worth the effort.