wesnoth-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-dev] Improving compile time - forward class declarations


From: Yann Dirson
Subject: [Wesnoth-dev] Improving compile time - forward class declarations
Date: Wed, 9 Mar 2005 19:28:49 +0100
User-agent: Mutt/1.5.6+20040907i

There are a number of header files which only use some classes in
function/method prototypes, and do not have any real use of the full
class definition and all stuff defined in the corresponding header
file.  Doing this causes many headers to be indirectly included by cpp
files, and then surely increases compilation time.

Ex: many headers include display.hpp, just because the function
prototypes declare passing a display object by pointer or reference.

Final #includers may not have a use for these includes, since they may
just pass a pointer or reference they got as a parameter down to other
functions, without really using them.

mapgen and cavegen are perfect examples, where even the implementation
has no use for the display object.

Would there any problem to replace these includes by simple forward
class declarations in the relevant header files (eg. "class display;"
in mapgen.hpp) ?

-- 
Yann Dirson    <address@hidden> |
Debian-related: <address@hidden> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]