Boost logo

Boost :

From: Peter Bartlett (pete_at_[hidden])
Date: 2008-08-14 12:51:35


Hi Boost community,

Would it practical to add a rule of thumb to the developer guidelines
that library developers should offer a fwd declaration header for
their library when possible?

For me the rationale is as follows:

- Boost headers are relatively heavy includes
- Pre-compiled headers are only available on a subset of compilers.
- Client side forward declarations are often problematic. E.g.

- - Boost.Tuple: redeclarations of default template arguments are
illegal (although MSVC lets you do it if you are prepared to suffer a
warning) so including boost/tuple.hpp after
mylibraryutils/boost_tuple_fwd.hpp is illegal.

- - Boost.Function : The removal of the allocator template parameter
has broken our code when we experimentally checked the 1.36 beta, as
our forward declarations of Boost.Functions are now wrong.

The existence of boost/tuple/tuple_fwd.hpp and
boost/function/function_fwd.hpp would thus have significantly improved
the user experience in my case.

Thanks for listening,
Pete Bartlett


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