Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 09/27/2011 10:55 AM, Michael Meeks wrote:
        I'm still a tad annoyed by our compile times, and was wondering - has a
footypes.hxx header approach been tried in the past. This would add a
near complete set of forward declarations of classes, templates, etc.
necessary to use that library.

        I suspect (at the moment) that people tend to simply include the header
that creates whatever definition they care about in their headers
chaining them together into bulky masses of pulled in headers, rather
than whacking things like:

namespace com { namespace sun { namespace star { namespace uno {
        class Any;
        class Exception;
        template<  typename>  class Reference;
        template<  typename>  class Sequence;
        class XInterface;
} } } }
namespace rtl { class OUString; }

        into their headers to cut such chains (and who can blame them - that
seems much more readable). Though of course the base Reference class is
prolly something that we should have ~everywhere - with fwd. decls for
the interface classes themselves.

        Potentially, by switching to lazily including just the svxtypes.hxx (or
whatever) header ~everywhere, we could have a smaller, quicker to parse
code-base (pwrt. no in-lines that get actually compiled) as well as a
rather more bearable dependency tree.

        Did anyone research this sort of thing in the past ?

Sometimes forward declarations suffice, sometimes the true definition is needed, so I guess you would end up in each header with a mix of footypes.hxx plus a list of whatever, and that list would start to grow again quite quickly (and hardly ever shrink during maintenance).

So, I'm more in favour of tools like those that Noel pointed out, that can be run once every while over the code base to find unnecessary includes (could actually become an easy hack then). Should be interesting to look into such tools, whether they work fine for our code base...

-Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.