Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2006-08-20 10:28:50


Robert Ramey wrote:
> Jeff Garland wrote:
>
>>> Is there some kind of Boost convention or policy
>>> on whether a library should offer a comprehensive "declare
>>> everything in the library" header in addition to more targeted
>>> headers?
>
> Personally, I avoid the "comprehensive" headers. I personally
> feel uncomfortable with the idea if including unused stuff
> as a side effect. This is especially true now that this
> extra stuff may include templates.

Hmm, most template code amounts to nothing other than a slightly slower
compile if you don't instantiate it. That's certainly the case for date-time.

> This is one reason that the serialization library has no such
> "comprehensive" header defined. The other reason is that
> it's not clear how much such a header might include - all
> possible archives? all stl serialization. etc. Finally, at
> least in the serialization library, the mere inclusion of
> a header can result in the instantiation of code which
> is never called - thereby adding to code bloat.

I think a few years ago I would have agreed with this, but I think the "size"
issues just don't apply that much on modern machines.

> So, I think the issue would be best addressed by discouraging
> the creation and usage of "comprehensive" headers. Of
> course, for me that is not a big issue as I avoid their usage
> in any case.

> Now, that does raise the issue that sometimes a compilation
> error arise for the lack of a specific header and that the
> error message is non-obvious. I'm not sure, but
> perhaps this can be alleviated by more/better usage
> of concept checking in library headers.

I don't see how...

I think the ultimate cost is minimal -- a simple statement in the docs
explaining the costs in the docs and the same as a comment in the
comprehensive header. As long as the fine grain headers are available those
can continue to be used.

Jeff


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net