[fpc-devel] Circular references and forward declarations

Florian Klaempfl florian at freepascal.org
Wed Jan 6 13:04:25 CET 2010


Jonas Maebe schrieb:
> 
> On 06 Jan 2010, at 12:14, Florian Klaempfl wrote:
> 
>> Different languages, different habits. I even consider putting every
>> class in its own header and implementation file as a bad habit. There is
>> no reason to do anymore because modern C/C++ compiler can smartlink on a
>> sub-object level which they could not for years.
> 
> Another reason is probably to speed up the compilation:
> * (re)compiling huge source files can be slow and/or require lots of
> memory, depending on the used compiler (and debug information or
> optimization settings)

For single class c++ files, imo most of the time is spent into reading
the huge headers which are often even not needed and a complete mess
because nobody has an overview which classes are used and which not.

> * every separate C/C++ file can be compiled in parallel with all others

That's might be a point.



More information about the fpc-devel mailing list