Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2006-01-18 21:19:41

"Tobias Schwinger" <tschwinger_at_[hidden]> wrote

> Suggestions on possible schemes:
> ( 'a_lib' in the examples denotes a placholder for the name of the
> 'a_component.hpp' denotes the name of a public header of the library. )
> 1. Create a 'typeof_support' directory reflecting the public headers of
> library. The user enables Typeof support by including additional headers.
> Example:
> #include <boost/a_lib/a_component.hpp>
> // ^^^ usual library header
> #include <boost/a_lib/typeof_support/a_component.hpp>
> // ^^^ contains the registration for the header above

This scheme looks similar to what we've done with std headers. It may make
sense for typeof_support/a_component.hpp to include a_component.hpp.

> 2. The Typeof registration is done in one separate header per library
> that checks the include guards to register the components,

Thus avoiding the nead to forward-declare everything?

> where the registration
> is guarded by "registration guards" (as suggested by Arkadiy Vertleyb
> in the "Typeof and MPL" thread).

It was first suggested by David Abrahams, and was meant to synchronize
registrations of the same library done by different library users. What you
are suggesting sounds like a new idea to me, and I am not sure I completely
understand this. Can you ellaborate?

>The user enables Typeof support for the whole library by
> including a single header.
> Example:
> #include <boost/a_lib/a_component.hpp>
> #include <boost/a_lib/typeof_support.hpp>
> // The typeof_support header would do the following:
> // - Check the include guard macros to see which files have been
> // included
> // +-- For each of these files: register the components defined
> // (guarded by a "registration guard macro")
> // - Define a macro to notify library headers #includeD later that
> // Typeof support header has to be re-#includeD
> // (for large libraries this approach can be applied on a per-module
> 3. The Typeof registration is put into the library's headers protected by
> conditional. The user enables (or disables) Typeof support by defining a
> Example:
> // ^^^ (or even do it in the Jamfile)
> #include <boost/a_lib/a_component.hpp>


Boost list run by bdawes at, gregod at, cpdaniel at, john at