Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] How to align USTRUCT

How can I align a USTRUCT in memory?

 struct alignas(64) FSomeStruct {}

UHT freaks out with error : Struct 'alignas' is missing a valid Unreal prefix, expecting 'Falignas' Regular structs work fine.

As a workaround I'm using dummy padding members e.g. uint32 Padding[8];

Product Version: UE 4.20
more ▼

asked Oct 18 '18 at 07:03 AM in C++ Programming

avatar image

108 5 15 14

(comments are locked)
10|2000 characters needed characters left

The question has been closed Nov 02 '18 at 11:18 PM by GlassBeaver for the following reason:

The question is answered, right answer was accepted

2 answers: sort voted first

Submitted a bug, got fixed, ETA 4.22 - nice! https://issues.unrealengine.com/issue/UE-65746

more ▼

answered Nov 02 '18 at 11:14 PM

avatar image

108 5 15 14

(comments are locked)
10|2000 characters needed characters left

That clearly means UHT don't recognize alignas, but this can also mean reflection system don't support alignas all together as it need to track memory addresses so it needs to support it. Non-USTRUCT obviously work since UHT is not concerned about them and those don't land to reflection system.

You might try reporting a bug:


You should get clear responce whatever there intention from Epic to support them, i got when i questioned UTF16 surrogates support (for characters above 0xFFFF) in Slate

more ▼

answered Oct 18 '18 at 09:09 PM

avatar image

34.6k 917 164 1095

avatar image GlassBeaver Oct 18 '18 at 10:53 PM

I've reported it, fwiw it's HeaderParser.cpp that won't parse them.

avatar image Shadowriver Oct 19 '18 at 05:02 AM

Yea but it not only need to be parsed but also applied in reflection system in to UStruct class. The response will be send to your email

avatar image NightFire80 Oct 20 '18 at 01:25 PM

AFAIK this isn't really a bug a USTRUCT is a class under the hood not a struct so its apples and oranges. Use an aligned native struct nested inside a USTRUCT should work.

(comments are locked)
10|2000 characters needed characters left

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question