Where to place the headers we need in the IWYU approach?

Once we’re on IWYU paradigm, we need to include many libraries everytime. We could include it into our .cpp or into our .h. Second one seems better in general, but in Visual Studio you get errors when you add an include in these files. It is a well-known error happening when you add an include just before the class beggining, that is, the UCLASS(…) line (however the error VS recognizes is showed on the GENERATED_BODY() line). And that is such a cumbersome fact. So we might be tempted to import into the other file, the .cpp, what is not a good practice generally. So, what we must do? Or, there is any fast solution to that well-known VS error?
Thanks.

1 Like

Privacy & Terms