x

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"

Where do i include (and in which order) my headers file ? Im having problems whit order

I have a project named ProgettoCLParticle and i need to now where is the best place to put includes. It's a set of plain classes whit .cpp and .h paired. I have cyclic dependency. In each .h there is #pragma once

Product Version: UE 4.9
Tags:
more ▼

asked Nov 24 '15 at 05:20 PM in C++ Programming

avatar image

SaverioFrancesco
1 2

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

1 answer: sort voted first

In general, there should be no need for one UCLASS-declaring header to include another UCLASS-declaring header. Since UObject members in your classes will always be pointers rather than direct values, it's sufficent to simply put class UMyObject; above the class holding a UMyObject reference, or to declare it as UPROPERTY() class UMyObject* MyObject instead of simply UPROPERTY() UMyObject* MyObject.

An exception to this is when one UCLASS subclasses another, but that should only be a one-way include.

If you're holding USTRUCTs in your objects, you'll need to include the header for those. It may be necessary to put the USTRUCT in its own header to avoid cyclic dependencies.

And .cpp files can include as many headers as they want without giving rise to cyclic inclusions.

more ▼

answered Nov 24 '15 at 07:13 PM

avatar image

Sneftel
470 20 20 40

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question