
----- Original Message ----- From: "Emil Dotchevski" <emil@revergestudios.com> To: <boost@lists.boost.org> Sent: Friday, September 05, 2008 7:22 PM Subject: Re: [boost] Automating the header compilation check. was :[thread]1.36 thread.hpp compilation problem
On Fri, Sep 5, 2008 at 2:10 AM, John Maddock <john@johnmaddock.co.uk> wrote:
vicente.botet wrote: BTW, it's not sufficient to simply include the header: if the header contains templates, then you also need to instantiate those templates to ensure everything they use is visible to them. Not sure how one would automate that :-(
I do think that we should have a system that automatically verifies that all public header files compile by themselves, but any #includes beyond what's needed to compile the header itself are not desirable. I specifically don't want any #includes that are not needed until a template is instantiated.
If we have an automatic header test, I'd like it to attempt to remove #includes until it finds the minimum needed to compile the file, because I'm sure we have many #includes that perhaps were needed before but are no longer necessary.
I want to quote what Larry Evans said on another post "FWIW, I think this is a good test for every library header. I confess I've often wondered whether many of my headers include 1) too much or 2) not enough. This test would at least assure the 2) doesn't happen. " What you are asking corresponds to 1). It will be glad to have such a automatic system, but it will need surely much more effort to get working, and also a lot of compile time. Note that 2) has already been implemented by Steave W. Best, Vicente