Translations:Development/Tutorials/Common Programming Mistakes/38/en: Difference between revisions

From KDE TechBase
(Importing a new version from external source)
 
(No difference)

Latest revision as of 07:31, 26 October 2019

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/Common Programming Mistakes)
You will reduce compile times by forward declaring classes when possible instead of including their respective headers. The rules for when a type can be used without being defined are a bit subtle, but intuitively, if the only important aspect is the name of the class, not the details of its implementation, a forward declaration is permissible. Two examples are when declaring pointers to the class or using the class as a function argument.

You will reduce compile times by forward declaring classes when possible instead of including their respective headers. The rules for when a type can be used without being defined are a bit subtle, but intuitively, if the only important aspect is the name of the class, not the details of its implementation, a forward declaration is permissible. Two examples are when declaring pointers to the class or using the class as a function argument.