on using #include *.h files

From: Tomas Frydrych (tomasfrydrych_at_yahoo.co.uk)
Date: Sat Dec 13 2003 - 17:04:20 EST

  • Next message: Tomas Frydrych: "endCVSscrewup()"

    This morning MSVC refused to pre-copile headers because of the size
    of debug info in the precompiled code; trying to limit what gets
    precompiled proved useless ad files are 'leaking in' from other
    files; without pre-compiling the compilation time
    increased unbearably.

    So I have embarked on a mission of cleaning up various unecessary
    #include statements; I have now commited cleanup of fv_view.h; this
    is very likely to screw things up in platform code, as some types
    might not be defined because they were so as side-effects of
    inclusion in fv_view.h. I appologise for this, but deem it
    unavoidable evil.

    Please, use #include in header files only when _really_
    necessary. Unless a class is instantiated in the header file, it is
    enough to use forward declaration, e.g.,

       class myclass;

    (Classes are only instantiated if variables of that type are declared
    in the header file, but not mere pointers or references to that type)

    When defining enums, do not place them inside class definitions
    unless they are not going to be used outside of that class; if the
    enum is defined in the class, it is necessary to include the whole
    class definition in order to be able to use it; this means including
    further files the class definition needs, and further files those
    files need, etc.

    I think we should adopt universally the approach that the Founding
    Fathers had in mind when designing the piectable, gathering various
    typdefs into pt_types.h. I have added ap_types.h and fp_types.h for
    that very purpose and moved some enums in there (I expect xap_types.h
    is to come as well.

    Tomas



    This archive was generated by hypermail 2.1.4 : Sat Dec 13 2003 - 17:04:04 EST