|
Re: Why is papyrus generating separate .cpp and .h files for class methods? [message #1835173 is a reply to message #1834931] |
Thu, 26 November 2020 10:35 |
|
Splitting the code corresponding to a class into a header and body file is a common code generation pattern. The header file contains the declaration, the body the method implementations with the code. The main motivation for this pattern is classes are referenced by others which must therefore know the declarations. If we had single files, the required #includes in the code would also include the implementation which would imply duplicating implementations and thus linkage errors. Another aspect is that implementations often have additional dependencies and the risk of getting circular dependencies would increase the single files are used.
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02873 seconds