Boost logo

Boost :

Subject: Re: [boost] Automating the header compilation check. was : [thread]1.36 thread.hpp compilation problem
From: David Abrahams (dave_at_[hidden])
Date: 2008-09-05 14:39:05


on Fri Sep 05 2008, "Emil Dotchevski" <emil-AT-revergestudios.com> wrote:

> On Fri, Sep 5, 2008 at 2:10 AM, John Maddock <john_at_[hidden]> 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 disagree. I may be able to use std::sort after #including only
<vector>, because something in <vector> needs something in <algorithm>.
My code should still #include <algorithm>, though.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk