What is CoreMinimal.h include for?

Documentation for IWYU tells to include CoreMinimal to the class header, and when you creating classes from the editor, it includes CoreMinimal by default as well, but I can’t get what for exactly?
It is already included in the UObjectBase header and removing it from created header doesn’t seem to affect the build (even with nonempty headers, that using mentioned in the documentation data types)

1 Like

Seems to be indeed useless and an artifact of someone still not getting what IWYU is all about.

After some more research on the IWYU topic, I’ve got that I’ve missed some parts of it.

IWYU not only tells to include exact headers that you need instead of including more generic ones but also tells not to rely on other headers include what you need, so you can freely change your own includes without fear that you’ll break someone else code.

So you need to include CoreMinimal.h in your own header to make sure that if something will be changed up in the hierarchy, it won’t break your header (but you’d better to include exact headers you need instead of this summary header)

1 Like

Your answer makes sense up until the last sentence, where you should draw the exact opposite conclusion. BECAUSE you should include exactly all headers that you need in your header, you should NOT include any “summary header” like CoreMinimal.h. For example, if you use any FString, you SHOULD include UnrealString.h directly.

Actually, yes, you are right, including a summary header like this goes against IWYU.
Guess Epics decided to make one (I hope) exception with this header.